USE [RD4_DWCR]
GO
/****** Object:  User [RRUSER]    Script Date: 5/30/13 10:14:47 AM ******/
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'RRUSER')
CREATE USER [RRUSER] FOR LOGIN [rruser] WITH DEFAULT_SCHEMA=[dbo]
GO
sys.sp_addrolemember @rolename = N'db_owner', @membername = N'RRUSER'
GO
/****** Object:  Schema [MSReplPAL_29_1]    Script Date: 5/30/13 10:14:47 AM ******/
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'MSReplPAL_29_1') print 'SKIP Schemas'
--EXEC sys.sp_executesql N'CREATE SCHEMA [MSReplPAL_29_1] AUTHORIZATION [MSReplPAL_29_1]'

GO
/****** Object:  Schema [MStran_PAL_role]    Script Date: 5/30/13 10:14:47 AM ******/
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'MStran_PAL_role') print 'SKIP Schemas'
--EXEC sys.sp_executesql N'CREATE SCHEMA [MStran_PAL_role] AUTHORIZATION [MStran_PAL_role]'

GO
/****** Object:  Schema [Payroll]    Script Date: 5/30/13 10:14:47 AM ******/
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = N'Payroll') 
EXEC sys.sp_executesql N'CREATE SCHEMA [Payroll] AUTHORIZATION [dbo]'

GO
/****** Object:  StoredProcedure [dbo].[USP_BusinessUnit_Security]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_BusinessUnit_Security]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE                PROCEDURE [dbo].[USP_BusinessUnit_Security]
-------------------------------------------------------------------------------
--Procedure Name:	USP_BusinessUnit_Security                                                                     
--Author:			Andrews Consulting Group                                                                        
--Date Created:     04/25/2003                                                                                      
--Date Modified/By:                                                                                                  
-------------------------------------------------------------------------------
-- This procedure is responsible for creating a table for use with a Business 
-- Objects Universe for purposes of Business Unit Security 
-------------------------------------------------------------------------------

AS

Truncate Table RD4_DWCR.dbo.JDEBOBusinessUnitSecurity



--JDEGSBusinessUnitSecurity Information
--Insert User Level Security Information
INSERT RD4_DWCR.dbo.JDEBOBusinessUnitSecurity 

Select
	BOUserID 	= BCR.BOUserID,
	JDEUserID	= BUS.UserID,
	BUFrom		= BUS.BUFrom,
	BUTo		= BUS.BUThru

From 
	RD4_DWCR.dbo.JDEGSBusinessUnitSecurity BUS 
	INNER JOIN RD4_DWCR.dbo.JDEBOUserCrossReference BCR ON
	BUS.UserID = BCR.JDEUserID

--JDELibraryListUser Information
--Insert Group Level Information against Users without USER Level security
INSERT JDEBOBusinessUnitSecurity
Select
	BOUserID 	= BCR.BOUserID,
	JDEUserID	= LLU.UserID,
	BUFrom		= BUS.BUFrom,
	BUTo		= BUS.BUThru

From 
	RD4_DWCR.dbo.JDEGSLibraryListsUser LLU 
	INNER JOIN RD4_DWCR.dbo.JDEBOUserCrossReference BCR ON
	BCR.JDEUserID = LLU.UserID 
	INNER JOIN RD4_DWCR.dbo.JDEGSBusinessUnitSecurity BUS ON
	BUS.UserID = LLU.UserClassGroup
Where 
	LLU.UserID NOT IN (Select Distinct JDEUserID From RD4_DWCR.dbo.JDEBOBusinessUnitSecurity)

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_BusinessUnit_Security] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_CDC_Cleanup]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_CDC_Cleanup]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_CDC_Cleanup]
AS
------------------------------------------------------------------------------------
--	Author:			c Copyright 2004 Andrews Consulting Group 
--	Procedure:		USP_CDC_Cleanup
--
--	Description: User Stored Procedure To Cleanup transactions in the Distribution Database.
--				 Cleanup will be based on DI Metadata CDC pointers.  
--				 All transactions prior to these pointers will be deleted.
--				 
--	Application: Data Integrator CDC cleanup
--      **********************************************************
--	YOU MUST CHANGE THE DATABASE FOR THE DI REPOSITORY
--	Search for DI_REPOSITORY and replace with DB Name
--	**********************************************************
--Modification History
--
--Date			Modified By		Description
--01.01.2001 		<developer name>	<comments>
---------------------------------------------------------------------------------------

DECLARE @SQLSTRING AS NVARCHAR(2000)
DECLARE @POINTER AS NVARCHAR(100)
DECLARE @PARMDEFINITION NVARCHAR(500)
DECLARE @LASTPOSITION AS VARCHAR(100)
DECLARE @POINTERDATE AS DATETIME
DECLARE @tablename VARCHAR(50)
DECLARE @STRING VARCHAR(4000)
DECLARE @articleid int
DECLARE @publicationid int
DECLARE @NumOfRows int
DECLARE @TotalRows int
DECLARE @Error int

set nocount on
DECLARE Table_cursor CURSOR FOR
	SELECT  Distinct CDC_Table FROM DI_REPOSITORY.dbo.AL_CDC_CHECKPOINT where last_position <>''0'' 
OPEN Table_cursor
FETCH FROM Table_cursor into @tablename
 
WHILE @@FETCH_STATUS = 0
 
BEGIN
-----------------------------------------------------------------------------------------------------------
-- Load the @LASTPOSITION variable with the minimum checkpoint value from DI Metadata AL_CDC_CHECKPOINT
-----------------------------------------------------------------------------------------------------------
SELECT @LASTPOSITION = ''0x'' + (SELECT  min(LAST_POSITION) FROM DI_REPOSITORY.dbo.AL_CDC_CHECKPOINT 
				where CDC_Table = @TableName)

-----------------------------------------------------------------------------------------------------------
-- Get the Article_id and Publication_ID from MSarticles
-----------------------------------------------------------------------------------------------------------
SELECT @publicationid = isnull(publication_id,0),@articleid=isnull(article_ID,0) FROM distribution.dbo.MSarticles 
				WHERE ARTICLE = @tablename


--set @NumOfRows =-1
set @TotalRows = 0
Begin tran DelTran
--while @NumOfRows <>0 
	--Begin
		set @NumOfRows =0
		set @SQLString = ''DELETE MSrepl_commands WITH (PAGLOCK) 
		from distribution.dbo.MSrepl_commands 
			where
				Article_ID = ''+cast(@articleid as varchar(10))+'' and
				publisher_database_id = ''+cast(@publicationid as varchar(10))+'' and
				xact_seqno < ''+@LASTPOSITION 

		EXEC (@SQLSTRING)
		select @numofRows = @@RowCount,@Error= @@ERROR
		IF @@Error != 0 GOTO Error_Routine

		Set @TotalRows  = @TotalRows +@NumOfRows
		
--End --While @numofRows >-1
Commit Tran DelTran
set @SQLSTRING = ''The article ''+@TableName +'' deleted ''+ cast(@totalrows as varchar(15))+'' transactions.''
print @SQLSTRING
	
FETCH NEXT FROM Table_cursor INTO @tablename
End 
Return 0 

CLOSE Table_cursor
DEALLOCATE Table_cursor 


-----------------------------------------------------------------------------------------------------------
--  if error then roll back trans and close cursor
-----------------------------------------------------------------------------------------------------------
Error_Routine:
	Rollback tran DelTran
	CLOSE Table_cursor
	DEALLOCATE Table_cursor

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_CDC_Cleanup] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_DTST_VALUE_TRANS]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_DTST_VALUE_TRANS]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE                   PROCEDURE [dbo].[USP_DTST_VALUE_TRANS]
-------------------------------------------------------------------------------
--Procedure Name:    USP_DTST_VALUE_TRANS
--Author:            c Copyright 2004 Andrews Consulting Group 
--                                                                       
--
--Date Modified/By:                                                                                                  
-------------------------------------------------------------------------------
--This procedure is responsible for populating DataMirror DTST_VALUE_TRANS
--for values required from table JDEGSUserDefinedCodes (F0005)
-------------------------------------------------------------------------------
AS


-- make sure that srcsysid matches int table ValueTransFieldReferences
-- matches the subscription name attached to the Central Repository

-- Delete all prior value_trans records which will be (re)created via this procedure.
DELETE TransformationServer52.dbo.DTST_VALUE_TRANS
FROM 
	TransformationServer52.dbo.DTST_VALUE_TRANS dts2
INNER JOIN
	RD4_DWCR.dbo.ValueTransFieldReferences   GCOL ON
		dts2.srcsysid 	= GCOL.srcsysid				AND
		dts2.srcfilnme 	= GCOL.srcfilnme			AND
		dts2.tgtentnme	= GCOL.tgtentnme			AND
		dts2.atrnme		= GCOL.atrnme	

INSERT INTO 
	TransformationServer52.dbo.DTST_VALUE_TRANS
		(
		srcsysid,
		srcfilnme,
		srcfillib,
		tgtentnme,
		tgtschema,
		atrnme,
		atroldval,
		atrnewval,
		tgtdb
		)
SELECT
	GCOL.srcsysid,
	GCOL.srcfilnme,
	GCOL.srcfillib,
	GCOL.tgtentnme,
	GCOL.tgtschema,
	GCOL.atrnme,
	RIGHT(UDC.UserDefinedCodesValues,UDT.CodeLength) AS UDCCode,
	CASE
		WHEN LEFT(UDC.Description01,26) = Space(26) THEN Space(20) + ''.''
		ELSE LEFT(UDC.Description01,26)
	END AS UDCValue, 
	GCOL.tgtdb
FROM 
	RD4_DWCR.dbo.ValueTransFieldReferences   GCOL
INNER JOIN 
		RD4_DWCR.dbo.JDEGSUserDefinedCodes UDC ON
	 	GCOL.InstallSystemCode	= UDC.InstallSystemCode AND
	 	GCOL.UserDefinedCode	= UDC.UserDefinedCode AND
	 	GCOL.SourceID			= UDC.SourceID
INNER JOIN 
		RD4_DWCR.dbo.JDEGSUserDefinedCodeTypes UDT ON
	 	GCOL.InstallSystemCode	= UDT.InstallSystemCode AND
	 	GCOL.UserDefinedCode	= UDT.UserDefinedCode AND
	 	GCOL.SourceID			= UDT.SourceID
WHERE NOT EXISTS (SELECT *
				FROM 
					TransformationServer52.dbo.DTST_VALUE_TRANS dts2
				WHERE
					dts2.srcsysid 	= GCOL.srcsysid				AND
					dts2.srcfilnme 	= GCOL.srcfilnme			AND
					dts2.tgtentnme	= GCOL.tgtentnme			AND
					dts2.atrnme		= GCOL.atrnme				AND
					dts2.atroldval	= UDC.UserDefinedCodesValues )

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_DTST_VALUE_TRANS] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_Prepare_ValueTransFieldRef]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_Prepare_ValueTransFieldRef]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE      PROCEDURE [dbo].[USP_Prepare_ValueTransFieldRef]

AS

-------------------------------------------------------------------------------
--Procedure Name:	USP_Prepare_ValueTransFieldRef                                                                     
--Author:		c Copyright 2004 Andrews Consulting Group
--                                                                                      
--Date Modified/By:                                                                                                  
-------------------------------------------------------------------------------
--This procedure is responsible for modifying client dependent data 
--in the ValueTransFieldReferences table.
-------------------------------------------------------------------------------
DECLARE @srcsysid	AS CHAR(30)
DECLARE @srcfillib	AS CHAR(30)
DECLARE @tgtdb		AS CHAR(30)
DECLARE @oldowner	AS CHAR(30)
DECLARE @newowner	AS CHAR(30)
DECLARE @SourceID	AS INT

SET	@srcsysid	= ''CRP1NH''
SET	@srcfillib	= ''PS_CRP.CRPDTA''
SET 	@tgtdb		= ''CRP_DWCR''
SET	@oldowner	= ''TESTDTA''
SET 	@newowner	= ''CRPDTA''
SET 	@SourceID	= 1


UPDATE 
	ValueTransFieldReferences
SET
	SourceID	= @SourceID,
	srcsysid 	= @srcsysid,
	srcfillib	= @srcfillib,
 	tgtdb 		= @tgtdb,
	srcfilnme	= REPLACE(srcfilnme,@oldowner,@newowner)

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_Prepare_ValueTransFieldRef] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_APMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_APMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_APMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	-- Adding the transactional articles
	exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEAPLedger'', @source_owner = N''dbo'', @source_object = N''JDEAPLedger'', @destination_table = N''JDEAPLedger'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEAPLedger'', @del_cmd = N''XCALL sp_MSdel_JDEAPLedger'', @upd_cmd = N''XCALL sp_MSupd_JDEAPLedger'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
	exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEAPMatchingDocumentDetail'', @source_owner = N''dbo'', @source_object = N''JDEAPMatchingDocumentDetail'', @destination_table = N''JDEAPMatchingDocumentDetail'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEAPMatchingDocumentDetail'', @del_cmd = N''XCALL sp_MSdel_JDEAPMatchingDocumentDetail'', @upd_cmd = N''XCALL sp_MSupd_JDEAPMatchingDocumentDetail'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
	exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEAPMatchingDocumentHeader'', @source_owner = N''dbo'', @source_object = N''JDEAPMatchingDocumentHeader'', @destination_table = N''JDEAPMatchingDocumentHeader'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEAPMatchingDocumentHeader'', @del_cmd = N''XCALL sp_MSdel_JDEAPMatchingDocumentHeader'', @upd_cmd = N''XCALL sp_MSupd_JDEAPMatchingDocumentHeader'', @filter = null, @sync_object = null, @auto_identity_range = N''false''


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_APMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_APMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_APMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_APMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	-- Drop the transactional articles
if exists(select * from distribution.dbo.MSarticles where article = ''JDEAPLedger'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEAPLedger'', @force_invalidate_snapshot = 1
if exists(select * from distribution.dbo.MSarticles where article = ''JDEAPMatchingDocumentDetail'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEAPMatchingDocumentDetail'', @force_invalidate_snapshot = 1
if exists(select * from distribution.dbo.MSarticles where article = ''JDEAPMatchingDocumentHeader'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEAPMatchingDocumentHeader'', @force_invalidate_snapshot = 1
END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_APMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_ARMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_ARMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_ARMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
-- Adding the transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEOWARAdjustments'', @source_owner = N''dbo'', @source_object = N''JDEOWARAdjustments'', @destination_table = N''JDEOWARAdjustments'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEOWARAdjustments'', @del_cmd = N''XCALL sp_MSdel_JDEOWARAdjustments'', @upd_cmd = N''XCALL sp_MSupd_JDEOWARAdjustments'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEOWARARDeductionActivity'', @source_owner = N''dbo'', @source_object = N''JDEOWARARDeductionActivity'', @destination_table = N''JDEOWARARDeductionActivity'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEOWARARDeductionActivity'', @del_cmd = N''XCALL sp_MSdel_JDEOWARARDeductionActivity'', @upd_cmd = N''XCALL sp_MSupd_JDEOWARARDeductionActivity'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEOWARARDeductionManagement'', @source_owner = N''dbo'', @source_object = N''JDEOWARARDeductionManagement'', @destination_table = N''JDEOWARARDeductionManagement'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEOWARARDeductionManagement'', @del_cmd = N''XCALL sp_MSdel_JDEOWARARDeductionManagement'', @upd_cmd = N''XCALL sp_MSupd_JDEOWARARDeductionManagement'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEOWARCheckDetail'', @source_owner = N''dbo'', @source_object = N''JDEOWARCheckDetail'', @destination_table = N''JDEOWARCheckDetail'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEOWARCheckDetail'', @del_cmd = N''XCALL sp_MSdel_JDEOWARCheckDetail'', @upd_cmd = N''XCALL sp_MSupd_JDEOWARCheckDetail'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEOWARDeductionActivityMast'', @source_owner = N''dbo'', @source_object = N''JDEOWARDeductionActivityMast'', @destination_table = N''JDEOWARDeductionActivityMast'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEOWARDeductionActivityMast'', @del_cmd = N''XCALL sp_MSdel_JDEOWARDeductionActivityMast'', @upd_cmd = N''XCALL sp_MSupd_JDEOWARDeductionActivityMast'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEOWARLedger'', @source_owner = N''dbo'', @source_object = N''JDEOWARLedger'', @destination_table = N''JDEOWARLedger'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEOWARLedger'', @del_cmd = N''XCALL sp_MSdel_JDEOWARLedger'', @upd_cmd = N''XCALL sp_MSupd_JDEOWARLedger'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEOWARReceiptsHeaderFile'', @source_owner = N''dbo'', @source_object = N''JDEOWARReceiptsHeaderFile'', @destination_table = N''JDEOWARReceiptsHeaderFile'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEOWARReceiptsHeaderFile'', @del_cmd = N''XCALL sp_MSdel_JDEOWARReceiptsHeaderFile'', @upd_cmd = N''XCALL sp_MSupd_JDEOWARReceiptsHeaderFile'', @filter = null, @sync_object = null, @auto_identity_range = N''false''


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_ARMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_ARMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_ARMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_ARMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

-- Dropping the transactional articles

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEOWARAdjustments'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEOWARAdjustments'', @force_invalidate_snapshot = 1
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEOWARARDeductionActivity'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEOWARARDeductionActivity'', @force_invalidate_snapshot = 1
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEOWARARDeductionManagement'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEOWARARDeductionManagement'', @force_invalidate_snapshot = 1
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEOWARCheckDetail'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEOWARCheckDetail'', @force_invalidate_snapshot = 1
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEOWARDeductionActivityMast'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEOWARDeductionActivityMast'', @force_invalidate_snapshot = 1
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEOWARLedger'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEOWARLedger'', @force_invalidate_snapshot = 1
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEOWARReceiptsHeaderFile'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEOWARReceiptsHeaderFile'', @force_invalidate_snapshot = 1


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_ARMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_Common_CREATE_CUSTOMERMASTERONLY]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_Common_CREATE_CUSTOMERMASTERONLY]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_Common_CREATE_CUSTOMERMASTERONLY]
	
AS
BEGIN

exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEARCMbyLineofBusines'', @source_owner = N''dbo'', @source_object = N''JDEARCMbyLineofBusines'', @destination_table = N''JDEARCMbyLineofBusines'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEARCMbyLineofBusines'', @del_cmd = N''XCALL sp_MSdel_JDEARCMbyLineofBusines'', @upd_cmd = N''XCALL sp_MSupd_JDEARCMbyLineofBusines'', @filter = null, @sync_object = null, @auto_identity_range = N''false''

-- added for addressbook 05/17/2012
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookAddressByDate'', @source_owner = N''dbo'', @source_object = N''JDEABAddressBookAddressByDate'', @destination_table = N''JDEABAddressBookAddressByDate'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEABAddressBookAddressByDate'', @del_cmd = N''XCALL sp_MSdel_JDEABAddressBookAddressByDate'', @upd_cmd = N''XCALL sp_MSupd_JDEABAddressBookAddressByDate'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookMaster'', @source_owner = N''dbo'', @source_object = N''JDEABAddressBookMaster'', @destination_table = N''JDEABAddressBookMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEABAddressBookMaster'', @del_cmd = N''XCALL sp_MSdel_JDEABAddressBookMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEABAddressBookMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookOrgStructure'', @source_owner = N''dbo'', @source_object = N''JDEABAddressBookOrgStructure'', @destination_table = N''JDEABAddressBookOrgStructure'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEABAddressBookOrgStructure'', @del_cmd = N''XCALL sp_MSdel_JDEABAddressBookOrgStructure'', @upd_cmd = N''XCALL sp_MSupd_JDEABAddressBookOrgStructure'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookWhosWho'', @source_owner = N''dbo'', @source_object = N''JDEABAddressBookWhosWho'', @destination_table = N''JDEABAddressBookWhosWho'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEABAddressBookWhosWho'', @del_cmd = N''XCALL sp_MSdel_JDEABAddressBookWhosWho'', @upd_cmd = N''XCALL sp_MSupd_JDEABAddressBookWhosWho'', @filter = null, @sync_object = null, @auto_identity_range = N''false''


END
' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_Common_CREATE_CUSTOMERMASTERONLY] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_Common_DROP_REP_CusomerMaster_Only]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_Common_DROP_REP_CusomerMaster_Only]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_Common_DROP_REP_CusomerMaster_Only]

AS
BEGIN

if exists(select * from distribution.dbo.MSarticles where article = ''JDEARCMbyLineofBusines'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEARCMbyLineofBusines'', @force_invalidate_snapshot = 1
END
' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_Common_DROP_REP_CusomerMaster_Only] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_CommonMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_CommonMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_CommonMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	-- Adding the transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookAddressByDate'', @source_owner = N''dbo'', @source_object = N''JDEABAddressBookAddressByDate'', @destination_table = N''JDEABAddressBookAddressByDate'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEABAddressBookAddressByDate'', @del_cmd = N''XCALL sp_MSdel_JDEABAddressBookAddressByDate'', @upd_cmd = N''XCALL sp_MSupd_JDEABAddressBookAddressByDate'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookMaster'', @source_owner = N''dbo'', @source_object = N''JDEABAddressBookMaster'', @destination_table = N''JDEABAddressBookMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEABAddressBookMaster'', @del_cmd = N''XCALL sp_MSdel_JDEABAddressBookMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEABAddressBookMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookOrgStructure'', @source_owner = N''dbo'', @source_object = N''JDEABAddressBookOrgStructure'', @destination_table = N''JDEABAddressBookOrgStructure'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEABAddressBookOrgStructure'', @del_cmd = N''XCALL sp_MSdel_JDEABAddressBookOrgStructure'', @upd_cmd = N''XCALL sp_MSupd_JDEABAddressBookOrgStructure'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookWhosWho'', @source_owner = N''dbo'', @source_object = N''JDEABAddressBookWhosWho'', @destination_table = N''JDEABAddressBookWhosWho'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEABAddressBookWhosWho'', @del_cmd = N''XCALL sp_MSdel_JDEABAddressBookWhosWho'', @upd_cmd = N''XCALL sp_MSupd_JDEABAddressBookWhosWho'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGSAccountFiscalDatePatterns'', @source_owner = N''dbo'', @source_object = N''JDEGSAccountFiscalDatePatterns'', @destination_table = N''JDEGSAccountFiscalDatePatterns'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGSAccountFiscalDatePatterns'', @del_cmd = N''XCALL sp_MSdel_JDEGSAccountFiscalDatePatterns'', @upd_cmd = N''XCALL sp_MSupd_JDEGSAccountFiscalDatePatterns'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEARCustomerMaster'', @source_owner = N''dbo'', @source_object = N''JDEARCustomerMaster'', @destination_table = N''JDEARCustomerMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEARCustomerMaster'', @del_cmd = N''XCALL sp_MSdel_JDEARCustomerMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEARCustomerMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEARCMbyLineofBusines'', @source_owner = N''dbo'', @source_object = N''JDEARCMbyLineofBusines'', @destination_table = N''JDEARCMbyLineofBusines'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEARCMbyLineofBusines'', @del_cmd = N''XCALL sp_MSdel_JDEARCMbyLineofBusines'', @upd_cmd = N''XCALL sp_MSupd_JDEARCMbyLineofBusines'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGSBusinessUnitMaster'', @source_owner = N''dbo'', @source_object = N''JDEGSBusinessUnitMaster'', @destination_table = N''JDEGSBusinessUnitMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGSBusinessUnitMaster'', @del_cmd = N''XCALL sp_MSdel_JDEGSBusinessUnitMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEGSBusinessUnitMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGSUserDefinedCodes'', @source_owner = N''dbo'', @source_object = N''JDEGSUserDefinedCodes'', @destination_table = N''JDEGSUserDefinedCodes'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGSUserDefinedCodes'', @del_cmd = N''XCALL sp_MSdel_JDEGSUserDefinedCodes'', @upd_cmd = N''XCALL sp_MSupd_JDEGSUserDefinedCodes'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGSUserDefinedCodeTypes'', @source_owner = N''dbo'', @source_object = N''JDEGSUserDefinedCodeTypes'', @destination_table = N''JDEGSUserDefinedCodeTypes'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGSUserDefinedCodeTypes'', @del_cmd = N''XCALL sp_MSdel_JDEGSUserDefinedCodeTypes'', @upd_cmd = N''XCALL sp_MSupd_JDEGSUserDefinedCodeTypes'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGSCompanyMaster'', @source_owner = N''dbo'', @source_object = N''JDEGSCompanyMaster'', @destination_table = N''JDEGSCompanyMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGSCompanyMaster'', @del_cmd = N''XCALL sp_MSdel_JDEGSCompanyMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEGSCompanyMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINBranchPlantConstants'', @source_owner = N''dbo'', @source_object = N''JDEINBranchPlantConstants'', @destination_table = N''JDEINBranchPlantConstants'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINBranchPlantConstants'', @del_cmd = N''XCALL sp_MSdel_JDEINBranchPlantConstants'', @upd_cmd = N''XCALL sp_MSupd_JDEINBranchPlantConstants'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINItemBranch'', @source_owner = N''dbo'', @source_object = N''JDEINItemBranch'', @destination_table = N''JDEINItemBranch'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINItemBranch'', @del_cmd = N''XCALL sp_MSdel_JDEINItemBranch'', @upd_cmd = N''XCALL sp_MSupd_JDEINItemBranch'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINItemMaster'', @source_owner = N''dbo'', @source_object = N''JDEINItemMaster'', @destination_table = N''JDEINItemMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINItemMaster'', @del_cmd = N''XCALL sp_MSdel_JDEINItemMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEINItemMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEAPSupplierMaster'', @source_owner = N''dbo'', @source_object = N''JDEAPSupplierMaster'', @destination_table = N''JDEAPSupplierMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEAPSupplierMaster'', @del_cmd = N''XCALL sp_MSdel_JDEAPSupplierMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEAPSupplierMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGAAccountMaster'', @source_owner = N''dbo'', @source_object = N''JDEGAAccountMaster'', @destination_table = N''JDEGAAccountMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGAAccountMaster'', @del_cmd = N''XCALL sp_MSdel_JDEGAAccountMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEGAAccountMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINCostLedger'', @source_owner = N''dbo'', @source_object = N''JDEINCostLedger'', @destination_table = N''JDEINCostLedger'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINCostLedger'', @del_cmd = N''XCALL sp_MSdel_JDEINCostLedger'', @upd_cmd = N''XCALL sp_MSupd_JDEINCostLedger'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGSPaymentTerms'', @source_owner = N''dbo'', @source_object = N''JDEGSPaymentTerms'', @destination_table = N''JDEGSPaymentTerms'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGSPaymentTerms'', @del_cmd = N''XCALL sp_MSdel_JDEGSPaymentTerms'', @upd_cmd = N''XCALL sp_MSupd_JDEGSPaymentTerms'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINBasePrice'', @source_owner = N''dbo'', @source_object = N''JDEINBasePrice'', @destination_table = N''JDEINBasePrice'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINBasePrice'', @del_cmd = N''XCALL sp_MSdel_JDEINBasePrice'', @upd_cmd = N''XCALL sp_MSupd_JDEINBasePrice'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
	-- Below are custom for FBC that is non standard RD transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINUOMConversionFactors'', @source_owner = N''dbo'', @source_object = N''JDEINUOMConversionFactors'', @destination_table = N''JDEINUOMConversionFactors'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINUOMConversionFactors'', @del_cmd = N''XCALL sp_MSdel_JDEINUOMConversionFactors'', @upd_cmd = N''XCALL sp_MSupd_JDEINUOMConversionFactors'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGSSupplementalData'', @source_owner = N''dbo'', @source_object = N''JDEGSSupplementalData'', @destination_table = N''JDEGSSupplementalData'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGSSupplementalData'', @del_cmd = N''XCALL sp_MSdel_JDEGSSupplementalData'', @upd_cmd = N''XCALL sp_MSupd_JDEGSSupplementalData'', @filter = null, @sync_object = null, @auto_identity_range = N''false''


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_CommonMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_CommonMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_CommonMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_CommonMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
-- Dropping the transactional articles
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEABAddressBookAddressByDate'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookAddressByDate'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEABAddressBookMaster'')
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookMaster'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEABAddressBookOrgStructure'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookOrgStructure'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEABAddressBookWhosWho'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEABAddressBookWhosWho'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEGSAccountFiscalDatePatterns'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGSAccountFiscalDatePatterns'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEARCustomerMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEARCustomerMaster'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEARCMbyLineofBusines'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEARCMbyLineofBusines'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEGSBusinessUnitMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGSBusinessUnitMaster'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEGSCompanyMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGSCompanyMaster'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEGSUserDefinedCodes'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGSUserDefinedCodes'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEGSUserDefinedCodeTypes'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGSUserDefinedCodeTypes'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINBranchPlantConstants'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINBranchPlantConstants'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINItemBranch'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINItemBranch'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINItemMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINItemMaster'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEAPSupplierMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEAPSupplierMaster'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEGAAccountMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGAAccountMaster'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINCostLedger'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINCostLedger'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEGSPaymentTerms'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGSPaymentTerms'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINBasePrice'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINBasePrice'', @force_invalidate_snapshot = 1


----- Below is custom for FBC, i.e. not standard RD base tables

if exists(select * from distribution.dbo.MSarticles where article = ''JDEINUOMConversionFactors'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINUOMConversionFactors'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEGSSupplementalData'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGSSupplementalData'', @force_invalidate_snapshot = 1

END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_CommonMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_FixedAssetsMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_FixedAssetsMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_FixedAssetsMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	-- Adding the transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFAAnnualDepreciationRules'', @source_owner = N''dbo'', @source_object = N''JDEFAAnnualDepreciationRules'', @destination_table = N''JDEFAAnnualDepreciationRules'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFAAnnualDepreciationRules'', @del_cmd = N''XCALL sp_MSdel_JDEFAAnnualDepreciationRules'', @upd_cmd = N''XCALL sp_MSupd_JDEFAAnnualDepreciationRules'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFAAssetAccountBalancesFile'', @source_owner = N''dbo'', @source_object = N''JDEFAAssetAccountBalancesFile'', @destination_table = N''JDEFAAssetAccountBalancesFile'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFAAssetAccountBalancesFile'', @del_cmd = N''XCALL sp_MSdel_JDEFAAssetAccountBalancesFile'', @upd_cmd = N''XCALL sp_MSupd_JDEFAAssetAccountBalancesFile'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFAAssetMasterFile'', @source_owner = N''dbo'', @source_object = N''JDEFAAssetMasterFile'', @destination_table = N''JDEFAAssetMasterFile'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFAAssetMasterFile'', @del_cmd = N''XCALL sp_MSdel_JDEFAAssetMasterFile'', @upd_cmd = N''XCALL sp_MSupd_JDEFAAssetMasterFile'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFADepreciationFormulas'', @source_owner = N''dbo'', @source_object = N''JDEFADepreciationFormulas'', @destination_table = N''JDEFADepreciationFormulas'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFADepreciationFormulas'', @del_cmd = N''XCALL sp_MSdel_JDEFADepreciationFormulas'', @upd_cmd = N''XCALL sp_MSupd_JDEFADepreciationFormulas'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFADepreciationPeriodSpread'', @source_owner = N''dbo'', @source_object = N''JDEFADepreciationPeriodSpread'', @destination_table = N''JDEFADepreciationPeriodSpread'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFADepreciationPeriodSpread'', @del_cmd = N''XCALL sp_MSdel_JDEFADepreciationPeriodSpread'', @upd_cmd = N''XCALL sp_MSupd_JDEFADepreciationPeriodSpread'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFADepreciationRules'', @source_owner = N''dbo'', @source_object = N''JDEFADepreciationRules'', @destination_table = N''JDEFADepreciationRules'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFADepreciationRules'', @del_cmd = N''XCALL sp_MSdel_JDEFADepreciationRules'', @upd_cmd = N''XCALL sp_MSupd_JDEFADepreciationRules'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFALocationTrackingTable'', @source_owner = N''dbo'', @source_object = N''JDEFALocationTrackingTable'', @destination_table = N''JDEFALocationTrackingTable'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFALocationTrackingTable'', @del_cmd = N''XCALL sp_MSdel_JDELocationTrackingTable'', @upd_cmd = N''XCALL sp_MSupd_JDEFALocationTrackingTable'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFAEquipmentMessages'', @source_owner = N''dbo'', @source_object = N''JDEFAEquipmentMessages'', @destination_table = N''JDEFAEquipmentMessages'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFAEquipmentMessages'', @del_cmd = N''XCALL sp_MSdel_JDEEquipmentMessages'', @upd_cmd = N''XCALL sp_MSupd_JDEFAEquipmentMessages'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFAEquipmentLicenseMaster'', @source_owner = N''dbo'', @source_object = N''JDEFAEquipmentLicenseMaster'', @destination_table = N''JDEFAEquipmentLicenseMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFAEquipmentLicenseMaster'', @del_cmd = N''XCALL sp_MSdel_JDEEquipmentLicenseMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEFAEquipmentLicenseMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFAMaintenanceScheduleFile'', @source_owner = N''dbo'', @source_object = N''JDEFAMaintenanceScheduleFile'', @destination_table = N''JDEFAMaintenanceScheduleFile'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFAMaintenanceScheduleFile'', @del_cmd = N''XCALL sp_MSdel_JDEMaintenanceScheduleFile'', @upd_cmd = N''XCALL sp_MSupd_JDEFAMaintenanceScheduleFile'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFAEquipmentPMScheduleModel'', @source_owner = N''dbo'', @source_object = N''JDEFAEquipmentPMScheduleModel'', @destination_table = N''JDEFAEquipmentPMScheduleModel'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFAEquipmentPMScheduleModel'', @del_cmd = N''XCALL sp_MSdel_JDEEquipmentPMScheduleModel'', @upd_cmd = N''XCALL sp_MSupd_JDEFAEquipmentPMScheduleModel'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFAEquipmentMasterExtension'', @source_owner = N''dbo'', @source_object = N''JDEFAEquipmentMasterExtension'', @destination_table = N''JDEFAEquipmentMasterExtension'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFAEquipmentMasterExtension'', @del_cmd = N''XCALL sp_MSdel_JDEEquipmentMasterExtension'', @upd_cmd = N''XCALL sp_MSupd_JDEFAEquipmentMasterExtension'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
-- exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEFASpecificationData'', @source_owner = N''dbo'', @source_object = N''JDEFASpecificationData'', @destination_table = N''JDEFASpecificationData'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEFASpecificationData'', @del_cmd = N''XCALL sp_MSdel_JDEFASpecificationData'', @upd_cmd = N''XCALL sp_MSupd_JDEFASpecificationData'', @filter = null, @sync_object = null, @auto_identity_range = N''false''

---  Added the article for JDECSInstalledBaseLocationHist  7/9/09   ACG
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDECSInstalledBaseLocationHist'', @source_owner = N''dbo'', @source_object = N''JDECSInstalledBaseLocationHist'', @destination_table = N''JDECSInstalledBaseLocationHist'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDECSInstalledBaseLocationHist'', @del_cmd = N''XCALL sp_MSdel_JDEEquipmentMasterExtension'', @upd_cmd = N''XCALL sp_MSupd_JDECSInstalledBaseLocationHist'', @filter = null, @sync_object = null, @auto_identity_range = N''false''	


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_FixedAssetsMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_FixedAssetsMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_FixedAssetsMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_FixedAssetsMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	-- Drop the transactional articles

	
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFAAnnualDepreciationRules'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFAAnnualDepreciationRules'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFAAssetAccountBalancesFile'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFAAssetAccountBalancesFile'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFAAssetMasterFile'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFAAssetMasterFile'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFADepreciationFormulas'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFADepreciationFormulas'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFADepreciationPeriodSpread'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFADepreciationPeriodSpread'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFADepreciationRules'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFADepreciationRules'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFALocationTrackingTable'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFALocationTrackingTable'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFAEquipmentMessages'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFAEquipmentMessages'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFAEquipmentLicenseMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFAEquipmentLicenseMaster'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFAMaintenanceScheduleFile'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFAMaintenanceScheduleFile'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFAEquipmentPMScheduleModel'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFAEquipmentPMScheduleModel'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFAEquipmentMasterExtension'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFAEquipmentMasterExtension'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEFASpecificationData'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEFASpecificationData'', @force_invalidate_snapshot = 1

---  Added the article for JDECSInstalledBaseLocationHist  7/9/09   ACG

	if exists(select * from distribution.dbo.MSarticles where article = ''JDECSInstalledBaseLocationHist'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDECSInstalledBaseLocationHist'', @force_invalidate_snapshot = 1




END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_FixedAssetsMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_GLMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_GLMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_GLMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	-- Adding the transactional articles
	exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGAAccountBalances'', @source_owner = N''dbo'', @source_object = N''JDEGAAccountBalances'', @destination_table = N''JDEGAAccountBalances'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGAAccountBalances'', @del_cmd = N''XCALL sp_MSdel_JDEGAAccountBalances'', @upd_cmd = N''XCALL sp_MSupd_JDEGAAccountBalances'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
	exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEGAAccountLedger'', @source_owner = N''dbo'', @source_object = N''JDEGAAccountLedger'', @destination_table = N''JDEGAAccountLedger'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEGAAccountLedger'', @del_cmd = N''XCALL sp_MSdel_JDEGAAccountLedger'', @upd_cmd = N''XCALL sp_MSupd_JDEGAAccountLedger'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
	
END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_GLMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_GLMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_GLMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_GLMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	-- Drop the transactional articles
if exists(select * from distribution.dbo.MSarticles where article = ''JDEGAAccountBalances'')		
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGAAccountBalances'', @force_invalidate_snapshot = 1
if exists(select * from distribution.dbo.MSarticles where article = ''JDEGAAccountLedger'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEGAAccountLedger'', @force_invalidate_snapshot = 1

END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_GLMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_HRMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_HRMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_HRMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	-- Adding the transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEHRApplicantMaster'', @source_owner = N''dbo'', @source_object = N''JDEHRApplicantMaster'', @destination_table = N''JDEHRApplicantMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEHRApplicantMaster'', @del_cmd = N''XCALL sp_MSdel_JDEHRApplicantMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEHRApplicantMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEHRBenefitsPlanMaster'', @source_owner = N''dbo'', @source_object = N''JDEHRBenefitsPlanMaster'', @destination_table = N''JDEHRBenefitsPlanMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEHRBenefitsPlanMaster'', @del_cmd = N''XCALL sp_MSdel_JDEHRBenefitsPlanMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEHRBenefitsPlanMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEHRDepBenToEmployeePlanXRef'', @source_owner = N''dbo'', @source_object = N''JDEHRDepBenToEmployeePlanXRef'', @destination_table = N''JDEHRDepBenToEmployeePlanXRef'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEHRDepBenToEmployeePlanXRef'', @del_cmd = N''XCALL sp_MSdel_JDEHRDepBenToEmployeePlanXRef'', @upd_cmd = N''XCALL sp_MSupd_JDEHRDepBenToEmployeePlanXRef'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEHREmployeeEnrollment'', @source_owner = N''dbo'', @source_object = N''JDEHREmployeeEnrollment'', @destination_table = N''JDEHREmployeeEnrollment'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEHREmployeeEnrollment'', @del_cmd = N''XCALL sp_MSdel_JDEHREmployeeEnrollment'', @upd_cmd = N''XCALL sp_MSupd_JDEHREmployeeEnrollment'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEHRJobinformation'', @source_owner = N''dbo'', @source_object = N''JDEHRJobinformation'', @destination_table = N''JDEHRJobinformation'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''drop'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEHRJobinformation'', @del_cmd = N''XCALL sp_MSdel_JDEHRJobinformation'', @upd_cmd = N''XCALL sp_MSupd_JDEHRJobinformation'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
--- The following article is created via the Payroll Mart
-- exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPYEmployeeMasterInfo'', @source_owner = N''dbo'', @source_object = N''JDEPYEmployeeMasterInfo'', @destination_table = N''JDEPYEmployeeMasterInfo'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPYEmployeeMasterInfo'', @del_cmd = N''XCALL sp_MSdel_JDEPYEmployeeMasterInfo'', @upd_cmd = N''XCALL sp_MSupd_JDEPYEmployeeMasterInfo'', @filter = null, @sync_object = null, @auto_identity_range = N''false''


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_HRMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_HRMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_HRMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_HRMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	-- Drop the transactional articles

if exists(select * from distribution.dbo.MSarticles where article = ''JDEHRApplicantMaster'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEHRApplicantMaster'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEHRBenefitsPlanMaster'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEHRBenefitsPlanMaster'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEHRDepBenToEmployeePlanXRef'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEHRDepBenToEmployeePlanXRef'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEHREmployeeEnrollment'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEHREmployeeEnrollment'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEHRJobinformation'')	
	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEHRJobinformation'', @force_invalidate_snapshot = 1

-- Commented out the following table because it''s in the Payroll Stored Procedure
--if exists(select * from distribution.dbo.MSarticles where article = ''JDEPYEmployeeMasterInfo'')	
--	exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPYEmployeeMasterInfo'', @force_invalidate_snapshot = 1


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_HRMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_InventoryMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_InventoryMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_InventoryMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	-- Adding the transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINItemLedger'', @source_owner = N''dbo'', @source_object = N''JDEINItemLedger'', @destination_table = N''JDEINItemLedger'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINItemLedger'', @del_cmd = N''XCALL sp_MSdel_JDEINItemLedger'', @upd_cmd = N''XCALL sp_MSupd_JDEINItemLedger'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINItemLocation'', @source_owner = N''dbo'', @source_object = N''JDEINItemLocation'', @destination_table = N''JDEINItemLocation'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINItemLocation'', @del_cmd = N''XCALL sp_MSdel_JDEINItemLocation'', @upd_cmd = N''XCALL sp_MSupd_JDEINItemLocation'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINLocationMaster'', @source_owner = N''dbo'', @source_object = N''JDEINLocationMaster'', @destination_table = N''JDEINLocationMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINLocationMaster'', @del_cmd = N''XCALL sp_MSdel_JDEINLocationMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEINLocationMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINLotMaster'', @source_owner = N''dbo'', @source_object = N''JDEINLotMaster'', @destination_table = N''JDEINLotMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINLotMaster'', @del_cmd = N''XCALL sp_MSdel_JDEINLotMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEINLotMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''

END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_InventoryMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_InventoryMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_InventoryMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_InventoryMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	-- Drop the transactional articles



	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINItemLedger'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINItemLedger'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINItemLocation'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINItemLocation'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINLocationMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINLocationMaster'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEINLotMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINLotMaster'', @force_invalidate_snapshot = 1



END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_InventoryMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_ManufacturingMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_ManufacturingMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_ManufacturingMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

-- Adding the transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEMPLowerLevelRequirement'', @source_owner = N''dbo'', @source_object = N''JDEMPLowerLevelRequirement'', @destination_table = N''JDEMPLowerLevelRequirement'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEMPLowerLevelRequirement'', @del_cmd = N''XCALL sp_MSdel_JDEMPLowerLevelRequirement'', @upd_cmd = N''XCALL sp_MSupd_JDEMPLowerLevelRequirement'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEMPMessageFile'', @source_owner = N''dbo'', @source_object = N''JDEMPMessageFile'', @destination_table = N''JDEMPMessageFile'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEMPMessageFile'', @del_cmd = N''XCALL sp_MSdel_JDEMPMessageFile'', @upd_cmd = N''XCALL sp_MSupd_JDEMPMessageFile'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
--  set to refresh mode for this table 
--  exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEMPSummaryFile'', @source_owner = N''dbo'', @source_object = N''JDEMPSummaryFile'', @destination_table = N''JDEMPSummaryFile'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEMPSummaryFile'', @del_cmd = N''XCALL sp_MSdel_JDEMPSummaryFile'', @upd_cmd = N''XCALL sp_MSupd_JDEMPSummaryFile'', @filter = null, @sync_object = null, @auto_identity_range = N''false''


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_ManufacturingMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_ManufacturingMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_ManufacturingMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_ManufacturingMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
-- Dropping the transactional articles
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEMPLowerLevelRequirement'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEMPLowerLevelRequirement'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEMPMessageFile'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEMPMessageFile'', @force_invalidate_snapshot = 1
	
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEMPSummaryFile'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEMPSummaryFile'', @force_invalidate_snapshot = 1


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_ManufacturingMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_PayrollMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_PayrollMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_PayrollMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

-- Adding the transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPYDBATransactionDetailHist'', @source_owner = N''dbo'', @source_object = N''JDEPYDBATransactionDetailHist'', @destination_table = N''JDEPYDBATransactionDetailHist'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPYDBATransactionDetailHist'', @del_cmd = N''XCALL sp_MSdel_JDEPYDBATransactionDetailHist'', @upd_cmd = N''XCALL sp_MSupd_JDEPYDBATransactionDetailHist'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPYEmployeeMasterInfo'', @source_owner = N''dbo'', @source_object = N''JDEPYEmployeeMasterInfo'', @destination_table = N''JDEPYEmployeeMasterInfo'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPYEmployeeMasterInfo'', @del_cmd = N''XCALL sp_MSdel_JDEPYEmployeeMasterInfo'', @upd_cmd = N''XCALL sp_MSupd_JDEPYEmployeeMasterInfo'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPYEmployeeTransactionDetl'', @source_owner = N''dbo'', @source_object = N''JDEPYEmployeeTransactionDetl'', @destination_table = N''JDEPYEmployeeTransactionDetl'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPYEmployeeTransactionDetl'', @del_cmd = N''XCALL sp_MSdel_JDEPYEmployeeTransactionDetl'', @upd_cmd = N''XCALL sp_MSupd_JDEPYEmployeeTransactionDetl'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPYEmployeeTransactionHist'', @source_owner = N''dbo'', @source_object = N''JDEPYEmployeeTransactionHist'', @destination_table = N''JDEPYEmployeeTransactionHist'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPYEmployeeTransactionHist'', @del_cmd = N''XCALL sp_MSdel_JDEPYEmployeeTransactionHist'', @upd_cmd = N''XCALL sp_MSupd_JDEPYEmployeeTransactionHist'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPYPayCheckHistoryTaxLedger'', @source_owner = N''dbo'', @source_object = N''JDEPYPayCheckHistoryTaxLedger'', @destination_table = N''JDEPYPayCheckHistoryTaxLedger'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPYPayCheckHistoryTaxLedger'', @del_cmd = N''XCALL sp_MSdel_JDEPYPayCheckHistoryTaxLedger'', @upd_cmd = N''XCALL sp_MSupd_JDEPYPayCheckHistoryTaxLedger'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPYPayrollTransactionConst'', @source_owner = N''dbo'', @source_object = N''JDEPYPayrollTransactionConst'', @destination_table = N''JDEPYPayrollTransactionConst'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPYPayrollTransactionConst'', @del_cmd = N''XCALL sp_MSdel_JDEPYPayrollTransactionConst'', @upd_cmd = N''XCALL sp_MSupd_JDEPYPayrollTransactionConst'', @filter = null, @sync_object = null, @auto_identity_range = N''false''

END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_PayrollMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_PayrollMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_PayrollMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_PayrollMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

-- Drop the transactional articles
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPYDBATransactionDetailHist'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPYDBATransactionDetailHist'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPYEmployeeMasterInfo'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPYEmployeeMasterInfo'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPYEmployeeTransactionDetl'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPYEmployeeTransactionDetl'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPYEmployeeTransactionHist'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPYEmployeeTransactionHist'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPYPayCheckHistoryTaxLedger'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPYPayCheckHistoryTaxLedger'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPYPayrollTransactionConst'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPYPayrollTransactionConst'', @force_invalidate_snapshot = 1


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_PayrollMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_PurchaseMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_PurchaseMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_PurchaseMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	
	-- Adding the transactional articles

exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPOPurchaseOrderDetail'', @source_owner = N''dbo'', @source_object = N''JDEPOPurchaseOrderDetail'', @destination_table = N''JDEPOPurchaseOrderDetail'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPOPurchaseOrderDetail'', @del_cmd = N''XCALL sp_MSdel_JDEPOPurchaseOrderDetail'', @upd_cmd = N''XCALL sp_MSupd_JDEPOPurchaseOrderDetail'', @filter = null, @sync_object = null, @auto_identity_range = N''false''

exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPOPurchaseOrderHeader'', @source_owner = N''dbo'', @source_object = N''JDEPOPurchaseOrderHeader'', @destination_table = N''JDEPOPurchaseOrderHeader'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPOPurchaseOrderHeader'', @del_cmd = N''XCALL sp_MSdel_JDEPOPurchaseOrderHeader'', @upd_cmd = N''XCALL sp_MSupd_JDEPOPurchaseOrderHeader'', @filter = null, @sync_object = null, @auto_identity_range = N''false''

exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEPOPurchaseOrderReceiver'', @source_owner = N''dbo'', @source_object = N''JDEPOPurchaseOrderReceiver'', @destination_table = N''JDEPOPurchaseOrderReceiver'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEPOPurchaseOrderReceiver'', @del_cmd = N''XCALL sp_MSdel_JDEPOPurchaseOrderReceiver'', @upd_cmd = N''XCALL sp_MSupd_JDEPOPurchaseOrderReceiver'', @filter = null, @sync_object = null, @auto_identity_range = N''false''


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_PurchaseMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_PurchaseMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_PurchaseMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_PurchaseMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

-- Dropping the transactional articles


	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPOPurchaseOrderDetail'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPOPurchaseOrderDetail'', @force_invalidate_snapshot = 1
	
	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPOPurchaseOrderHeader'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPOPurchaseOrderHeader'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEPOPurchaseOrderReceiver'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEPOPurchaseOrderReceiver'', @force_invalidate_snapshot = 1


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_PurchaseMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_SalesMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_SalesMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_SalesMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;


-- Adding the transactional articles
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDESOSalesOrderDetail'', @source_owner = N''dbo'', @source_object = N''JDESOSalesOrderDetail'', @destination_table = N''JDESOSalesOrderDetail'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDESOSalesOrderDetail'', @del_cmd = N''XCALL sp_MSdel_JDESOSalesOrderDetail'', @upd_cmd = N''XCALL sp_MSupd_JDESOSalesOrderDetail'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDESOSalesOrderDetailHistory'', @source_owner = N''dbo'', @source_object = N''JDESOSalesOrderDetailHistory'', @destination_table = N''JDESOSalesOrderDetailHistory'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDESOSalesOrderDetailHistory'', @del_cmd = N''XCALL sp_MSdel_JDESOSalesOrderDetailHistory'', @upd_cmd = N''XCALL sp_MSupd_JDESOSalesOrderDetailHistory'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEMPForecastFile'', @source_owner = N''dbo'', @source_object = N''JDEMPForecastFile'', @destination_table = N''JDEMPForecastFile'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEMPForecastFile'', @del_cmd = N''XCALL sp_MSdel_JDEMPForecastFile'', @upd_cmd = N''XCALL sp_MSupd_JDEMPForecastFile'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDESOSalesOrderHeader'', @source_owner = N''dbo'', @source_object = N''JDESOSalesOrderHeader'', @destination_table = N''JDESOSalesOrderHeader'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDESOSalesOrderHeader'', @del_cmd = N''XCALL sp_MSdel_JDESOSalesOrderHeader'', @upd_cmd = N''XCALL sp_MSupd_JDESOSalesOrderHeader'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDESOSalesOrderHeaderHistory'', @source_owner = N''dbo'', @source_object = N''JDESOSalesOrderHeaderHistory'', @destination_table = N''JDESOSalesOrderHeaderHistory'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDESOSalesOrderHeaderHistory'', @del_cmd = N''XCALL sp_MSdel_JDESOSalesOrderHeaderHistory'', @upd_cmd = N''XCALL sp_MSupd_JDESOSalesOrderHeaderHistory'', @filter = null, @sync_object = null, @auto_identity_range = N''false''


-- Added the table  FBCCustomerMasterCommissioninfo   7/9/09  ACG
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''FBCCustomerMasterCommissioninfo'', @source_owner = N''dbo'', @source_object = N''FBCCustomerMasterCommissioninfo'', @destination_table = N''FBCCustomerMasterCommissioninfo'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_FBCCustomerMasterCommissioninfo'', @del_cmd = N''XCALL sp_MSdel_FBCCustomerMasterCommissioninfo'', @upd_cmd = N''XCALL sp_MSupd_FBCCustomerMasterCommissioninfo'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
-- Below are additional custom FBC tables for SalesMart
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINPriceAdjustmentHistory'', @source_owner = N''dbo'', @source_object = N''JDEINPriceAdjustmentHistory'', @destination_table = N''JDEINPriceAdjustmentHistory'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINPriceAdjustmentHistory'', @del_cmd = N''XCALL sp_MSdel_JDEINPriceAdjustmentHistory'', @upd_cmd = N''XCALL sp_MSupd_JDEINPriceAdjustmentHistory'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINBasePriceAdjustmentDtail'', @source_owner = N''dbo'', @source_object = N''JDEINBasePriceAdjustmentDtail'', @destination_table = N''JDEINBasePriceAdjustmentDtail'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINBasePriceAdjustmentDtail'', @del_cmd = N''XCALL sp_MSdel_JDEINBasePriceAdjustmentDtail'', @upd_cmd = N''XCALL sp_MSupd_JDEINBasePriceAdjustmentDtail'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEINOrderGroupKeyIDMaster'', @source_owner = N''dbo'', @source_object = N''JDEINOrderGroupKeyIDMaster'', @destination_table = N''JDEINOrderGroupKeyIDMaster'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEINOrderGroupKeyIDMaster'', @del_cmd = N''XCALL sp_MSdel_JDEINOrderGroupKeyIDMaster'', @upd_cmd = N''XCALL sp_MSupd_JDEINOrderGroupKeyIDMaster'', @filter = null, @sync_object = null, @auto_identity_range = N''false''

END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_SalesMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_SalesMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_SalesMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_RD_SalesMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	-- Drop the transactional articles

	if exists(select * from distribution.dbo.MSarticles where article = ''JDESOSalesOrderDetail'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDESOSalesOrderDetail'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDESOSalesOrderDetailHistory'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDESOSalesOrderDetailHistory'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEMPForecastFile'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEMPForecastFile'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDESOSalesOrderHeader'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDESOSalesOrderHeader'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDESOSalesOrderHeaderHistory'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDESOSalesOrderHeaderHistory'', @force_invalidate_snapshot = 1
---added for F42140
if exists(select * from distribution.dbo.MSarticles where article = ''FBCCustomerMasterCommissioninfo'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''FBCCustomerMasterCommissioninfo'', @force_invalidate_snapshot = 1
---Custom FBC tables for Sales Mart
if exists(select * from distribution.dbo.MSarticles where article = ''JDEINPriceAdjustmentHistory'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINPriceAdjustmentHistory'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEINBasePriceAdjustmentDtail'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINBasePriceAdjustmentDtail'', @force_invalidate_snapshot = 1

if exists(select * from distribution.dbo.MSarticles where article = ''JDEINOrderGroupKeyIDMaster'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEINOrderGroupKeyIDMaster'', @force_invalidate_snapshot = 1

END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_SalesMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_WorkOrderMart_Create_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_WorkOrderMart_Create_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_WorkOrderMart_Create_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

-- Adding the transactional articles

exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDESFControlRoutingInstruct'', @source_owner = N''dbo'', @source_object = N''JDESFControlRoutingInstruct'', @destination_table = N''JDESFControlRoutingInstruct'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDESFControlRoutingInstruct'', @del_cmd = N''XCALL sp_MSdel_JDESFControlRoutingInstruct'', @upd_cmd = N''XCALL sp_MSupd_JDESFControlRoutingInstruct'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDESFShopFloorControlPartsList'', @source_owner = N''dbo'', @source_object = N''JDESFShopFloorControlPartsList'', @destination_table = N''JDESFShopFloorControlPartsList'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDESFShopFloorControlPartsList'', @del_cmd = N''XCALL sp_MSdel_JDESFShopFloorControlPartsList'', @upd_cmd = N''XCALL sp_MSupd_JDESFShopFloorControlPartsList'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
--  Already in MFG Create  exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEMPLowerLevelRequirement'', @source_owner = N''dbo'', @source_object = N''JDEMPLowerLevelRequirement'', @destination_table = N''JDEMPLowerLevelRequirement'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEMPLowerLevelRequirement'', @del_cmd = N''XCALL sp_MSdel_JDEMPLowerLevelRequirement'', @upd_cmd = N''XCALL sp_MSupd_JDEMPLowerLevelRequirement'', @filter = null, @sync_object = null, @auto_identity_range = N''false''
exec sp_addarticle @publication = N''RD4_DWCR'', @article = N''JDEWOWorkOrderMasterFile'', @source_owner = N''dbo'', @source_object = N''JDEWOWorkOrderMasterFile'', @destination_table = N''JDEWOWorkOrderMasterFile'', @type = N''logbased'', @creation_script = null, @description = null, @pre_creation_cmd = N''none'', @schema_option = 0x0000000002005081, @status = 0, @vertical_partition = N''false'', @ins_cmd = N''CALL sp_MSins_JDEWOWorkOrderMasterFile'', @del_cmd = N''XCALL sp_MSdel_JDEWOWorkOrderMasterFile'', @upd_cmd = N''XCALL sp_MSupd_JDEWOWorkOrderMasterFile'', @filter = null, @sync_object = null, @auto_identity_range = N''false''

END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_WorkOrderMart_Create_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RD_WorkOrderMart_Drop_Rep_Article]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RD_WorkOrderMart_Drop_Rep_Article]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[USP_RD_WorkOrderMart_Drop_Rep_Article]
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

-- Dropping the transactional articles


	if exists(select * from distribution.dbo.MSarticles where article = ''JDESFControlRoutingInstruct'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDESFControlRoutingInstruct'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDESFShopFloorControlPartsList'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDESFShopFloorControlPartsList'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEMPLowerLevelRequirement'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEMPLowerLevelRequirement'', @force_invalidate_snapshot = 1

	if exists(select * from distribution.dbo.MSarticles where article = ''JDEWOWorkOrderMasterFile'')	
exec sp_droparticle @publication = N''RD4_DWCR'', @article = N''JDEWOWorkOrderMasterFile'', @force_invalidate_snapshot = 1


END

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RD_WorkOrderMart_Drop_Rep_Article] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_RemoveNonUsedDWCRTables]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_RemoveNonUsedDWCRTables]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE   PROCEDURE [dbo].[USP_RemoveNonUsedDWCRTables]
-------------------------------------------------------------------------------
--Procedure Name:	USP_Apply_UDC_Changes                                                                     
--Author:			Andrews Consulting Group                                                                        
--Date Created:                                                                                           
--Date Modified/By:                                                                                                  
-------------------------------------------------------------------------------
--This procedure is responsible for updating all tables affected by changes
--made to included codes in the UDC Table.
-------------------------------------------------------------------------------
AS
--------------------------------------------------
-- This set of SQL statements assumes that the 
-- DI Repository is called DI_Local.
-- Please update based on client requirements.
--------------------------------------------------
-- Use this query to identify the tables that we 
-- are using in the implementation.
--------------------------------------------------
select distinct DI.name
  from DI_LOCAL.DBO.al_schema DI, sys.tables DWCR
 where DI.name = DWCR.name
   and DI.datastore = ''DS_RD_DWCR''
   and DWCR.name not in 
(''CDC_RunStatus''
,''DATES''
,''DATESPattern''
,''DatesPatternList''
,''DATESPatternTemp''
,''DATESPeriod''
,''DATESPeriodTemp''
,''Holidays''
,''RD_MONITOR_GL''
,''ValueTransFieldReferences''
,''ValueTransHostSource'' )
order by name

' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_RemoveNonUsedDWCRTables] TO  SCHEMA OWNER 
GO
/****** Object:  StoredProcedure [dbo].[USP_UnusedValueTransTable]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[USP_UnusedValueTransTable]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[USP_UnusedValueTransTable]

AS

select * 
--delete
  from dbo.ValueTransFieldReferences
 where exists (select name from sys.tables DWCR where DWCR.name = tgtentnme);
' 
END
GO
ALTER AUTHORIZATION ON [dbo].[USP_UnusedValueTransTable] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[CDC_RunStatus]    Script Date: 5/30/13 10:14:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CDC_RunStatus]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[CDC_RunStatus](
	[RunFlag] [int] NULL,
	[Subscription] [char](30) NOT NULL,
 CONSTRAINT [PK_CDC_RunStatus] PRIMARY KEY CLUSTERED 
(
	[Subscription] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[CDC_RunStatus] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[DATE_AGE_TEST]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DATE_AGE_TEST]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[DATE_AGE_TEST](
	[OPERATION] [varchar](1) NOT NULL,
	[DATESEQUENCE] [int] NOT NULL,
	[DATES] [datetime] NULL,
	[DATEID] [decimal](28, 0) NOT NULL,
	[APAGING] [varchar](10) NULL,
	[ARAGING] [varchar](10) NULL,
	[WORKDAY] [decimal](10, 0) NULL,
	[SALESDAY] [decimal](10, 0) NULL,
	[CALENDARROLLINGDAY] [decimal](10, 0) NULL,
	[FISCALROLLINGDAY] [decimal](10, 0) NULL,
	[CALENDARROLLINGWEEK] [decimal](10, 0) NULL,
	[FISCALROLLINGWEEK] [decimal](10, 0) NULL,
	[CALENDARROLLINGMONTH] [decimal](10, 0) NULL,
	[FISCALROLLINGMONTH] [decimal](10, 0) NULL,
	[CALENDARROLLINGQUARTER] [decimal](10, 0) NULL,
	[FISCALROLLINGQUARTER] [decimal](10, 0) NULL,
	[CALENDARROLLINGYEAR] [decimal](10, 0) NULL,
	[FISCALROLLINGYEAR] [decimal](10, 0) NULL,
PRIMARY KEY CLUSTERED 
(
	[OPERATION] ASC,
	[DATESEQUENCE] ASC,
	[DATEID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[DATE_AGE_TEST] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[DATES]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DATES]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[DATES](
	[Dates] [datetime] NOT NULL,
	[CalendarYear] [nchar](4) NOT NULL,
	[CalendarQuarter] [nchar](2) NOT NULL,
	[CalendarMonth] [nchar](2) NOT NULL,
	[CalendarMonthName] [nchar](10) NOT NULL,
	[CalendarMonthNameShort] [nchar](3) NOT NULL,
	[CalendarWeek] [nchar](2) NOT NULL,
	[CalendarDateWeekBegins] [datetime] NOT NULL,
	[CalendarJulian] [int] NOT NULL,
	[BalanceSheet] [nchar](24) NOT NULL,
	[IncomeSheet] [nchar](40) NOT NULL,
	[FiscalYear] [nchar](4) NOT NULL,
	[FiscalQuarter] [nchar](2) NOT NULL,
	[FiscalMonth] [nchar](2) NOT NULL,
	[FiscalMonthName] [nchar](10) NOT NULL,
	[FiscalMonthNameShort] [nchar](3) NOT NULL,
	[FiscalWeek] [nchar](2) NOT NULL,
	[FiscalDateWeekBegins] [datetime] NOT NULL,
	[FiscalJulian] [int] NOT NULL,
	[FiscalBalanceSheet] [nchar](24) NOT NULL,
	[FiscalIncomeSheet] [nchar](40) NOT NULL,
	[EndOfFiscalPeriod] [datetime] NOT NULL,
	[DayOfWeekNumber] [nchar](1) NOT NULL,
	[DayOfWeek] [nchar](10) NOT NULL,
	[DayOfWeekShort] [nchar](3) NOT NULL,
	[APAging] [nchar](10) NOT NULL,
	[ARAging] [nchar](10) NOT NULL,
	[DateID] [int] NOT NULL,
	[WorkDay] [int] NOT NULL,
	[WorkDayInMonth] [int] NOT NULL,
	[WorkDaysInMonth] [int] NOT NULL,
	[SalesDay] [int] NOT NULL,
	[SalesDayInMonth] [int] NOT NULL,
	[SalesDaysInMonth] [int] NOT NULL,
	[CalendarRollingDay] [int] NOT NULL,
	[FiscalRollingDay] [int] NOT NULL,
	[CalendarRollingWeek] [int] NOT NULL,
	[FiscalRollingWeek] [int] NOT NULL,
	[CalendarRollingMonth] [int] NOT NULL,
	[FiscalRollingMonth] [int] NOT NULL,
	[CalendarRollingQuarter] [int] NOT NULL,
	[FiscalRollingQuarter] [int] NOT NULL,
	[CalendarRollingYear] [int] NOT NULL,
	[FiscalRollingYear] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_DATES] PRIMARY KEY CLUSTERED 
(
	[DateID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[DATES] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[DATESPattern]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DATESPattern]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[DATESPattern](
	[Dates] [datetime] NOT NULL,
	[CalendarYear] [char](4) NOT NULL,
	[CalendarQuarter] [char](2) NOT NULL,
	[CalendarMonth] [char](2) NOT NULL,
	[CalendarMonthName] [char](10) NOT NULL,
	[CalendarMonthNameShort] [char](3) NOT NULL,
	[CalendarWeek] [char](2) NOT NULL,
	[CalendarDateWeekBegins] [datetime] NOT NULL,
	[CalendarJulian] [int] NOT NULL,
	[BalanceSheet] [char](24) NOT NULL,
	[IncomeSheet] [char](40) NOT NULL,
	[FiscalYear] [char](4) NOT NULL,
	[FiscalQuarter] [char](2) NOT NULL,
	[FiscalMonth] [char](2) NOT NULL,
	[FiscalMonthName] [char](10) NOT NULL,
	[FiscalMonthNameShort] [char](3) NOT NULL,
	[FiscalWeek] [char](2) NOT NULL,
	[FiscalDateWeekBegins] [datetime] NOT NULL,
	[FiscalJulian] [int] NOT NULL,
	[FiscalBalanceSheet] [char](24) NOT NULL,
	[FiscalIncomeSheet] [char](40) NOT NULL,
	[EndOfFiscalPeriod] [datetime] NOT NULL,
	[DayOfWeekNumber] [char](1) NOT NULL,
	[DayOfWeek] [char](10) NOT NULL,
	[DayOfWeekShort] [char](3) NOT NULL,
	[APAging] [char](10) NOT NULL,
	[ARAging] [char](10) NOT NULL,
	[DateID] [int] NOT NULL,
	[WorkDay] [int] NOT NULL,
	[WorkDayInMonth] [int] NOT NULL,
	[WorkDaysInMonth] [int] NOT NULL,
	[SalesDay] [int] NOT NULL,
	[SalesDayInMonth] [int] NOT NULL,
	[SalesDaysInMonth] [int] NOT NULL,
	[CalendarRollingDay] [int] NOT NULL,
	[FiscalRollingDay] [int] NOT NULL,
	[CalendarRollingWeek] [int] NOT NULL,
	[FiscalRollingWeek] [int] NOT NULL,
	[CalendarRollingMonth] [int] NOT NULL,
	[FiscalRollingMonth] [int] NOT NULL,
	[CalendarRollingQuarter] [int] NOT NULL,
	[FiscalRollingQuarter] [int] NOT NULL,
	[CalendarRollingYear] [int] NOT NULL,
	[FiscalRollingYear] [int] NOT NULL,
	[CorporateYear] [char](4) NOT NULL,
	[CorporateQuarter] [char](2) NOT NULL,
	[CorporateMonth] [char](2) NOT NULL,
	[CorporateMonthName] [char](10) NOT NULL,
	[CorporateMonthNameShort] [char](3) NOT NULL,
	[CorporateWeek] [char](2) NOT NULL,
	[CorporateWeekBegins] [datetime] NOT NULL,
	[CorporateBalanceSheet] [char](24) NOT NULL,
	[CorporateIncomeSheet] [char](40) NOT NULL,
	[EndOfCorporatePeriod] [datetime] NOT NULL,
	[FiscalDatePattern] [char](1) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[CompanyDateID] [bigint] NOT NULL
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[DATESPattern] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[DatesPatternList]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DatesPatternList]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[DatesPatternList](
	[FiscalDatePattern] [nchar](1) NOT NULL,
	[PatternNumber] [int] NOT NULL,
 CONSTRAINT [PK_DatesPatternList] PRIMARY KEY CLUSTERED 
(
	[FiscalDatePattern] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[DatesPatternList] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[DATESPatternTemp]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DATESPatternTemp]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[DATESPatternTemp](
	[Dates] [datetime] NOT NULL,
	[CalendarYear] [nchar](4) NOT NULL,
	[CalendarQuarter] [nchar](2) NOT NULL,
	[CalendarMonth] [nchar](2) NOT NULL,
	[CalendarMonthName] [nchar](10) NOT NULL,
	[CalendarMonthNameShort] [nchar](3) NOT NULL,
	[CalendarWeek] [nchar](2) NOT NULL,
	[CalendarDateWeekBegins] [datetime] NOT NULL,
	[CalendarJulian] [int] NOT NULL,
	[BalanceSheet] [nchar](24) NOT NULL,
	[IncomeSheet] [nchar](40) NOT NULL,
	[FiscalYear] [nchar](4) NOT NULL,
	[FiscalQuarter] [nchar](2) NOT NULL,
	[FiscalMonth] [nchar](2) NOT NULL,
	[FiscalMonthName] [nchar](10) NOT NULL,
	[FiscalMonthNameShort] [nchar](3) NOT NULL,
	[FiscalWeek] [nchar](2) NOT NULL,
	[FiscalDateWeekBegins] [datetime] NOT NULL,
	[FiscalJulian] [int] NOT NULL,
	[FiscalBalanceSheet] [nchar](24) NOT NULL,
	[FiscalIncomeSheet] [nchar](40) NOT NULL,
	[EndOfFiscalPeriod] [datetime] NOT NULL,
	[DayOfWeekNumber] [nchar](1) NOT NULL,
	[DayOfWeek] [nchar](10) NOT NULL,
	[DayOfWeekShort] [nchar](3) NOT NULL,
	[APAging] [nchar](10) NOT NULL,
	[ARAging] [nchar](10) NOT NULL,
	[DateID] [int] NOT NULL,
	[WorkDay] [int] NOT NULL,
	[WorkDayInMonth] [int] NOT NULL,
	[WorkDaysInMonth] [int] NOT NULL,
	[SalesDay] [int] NOT NULL,
	[SalesDayInMonth] [int] NOT NULL,
	[SalesDaysInMonth] [int] NOT NULL,
	[CalendarRollingDay] [int] NOT NULL,
	[FiscalRollingDay] [int] NOT NULL,
	[CalendarRollingWeek] [int] NOT NULL,
	[FiscalRollingWeek] [int] NOT NULL,
	[CalendarRollingMonth] [int] NOT NULL,
	[FiscalRollingMonth] [int] NOT NULL,
	[CalendarRollingQuarter] [int] NOT NULL,
	[FiscalRollingQuarter] [int] NOT NULL,
	[CalendarRollingYear] [int] NOT NULL,
	[FiscalRollingYear] [int] NOT NULL,
	[InsertIndicator] [int] NULL,
	[InsertDate] [datetime] NULL,
	[ChangeIndicator] [int] NULL,
	[ChangeDate] [datetime] NULL,
	[DeleteIndicator] [int] NULL,
	[DeleteDate] [datetime] NULL,
	[PurgeDate] [datetime] NULL,
	[CorporateYear] [char](4) NOT NULL,
	[CorporateQuarter] [char](2) NOT NULL,
	[CorporateMonth] [char](2) NOT NULL,
	[CorporateMonthName] [char](10) NOT NULL,
	[CorporateMonthNameShort] [char](3) NOT NULL,
	[CorporateWeek] [char](2) NOT NULL,
	[CorporateWeekBegins] [datetime] NOT NULL,
	[CorporateBalanceSheet] [char](24) NOT NULL,
	[CorporateIncomeSheet] [char](40) NOT NULL,
	[EndOfCorporatePeriod] [datetime] NOT NULL,
	[FiscalDatePattern] [char](1) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[CompanyDateID] [bigint] NOT NULL,
 CONSTRAINT [PK_DATESPatternTemp] PRIMARY KEY CLUSTERED 
(
	[DateID] ASC,
	[CompanyDateID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[DATESPatternTemp] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[DATESPeriod]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DATESPeriod]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[DATESPeriod](
	[PeriodID] [bigint] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[LocalYear] [char](4) NOT NULL,
	[LocalPeriod] [char](2) NOT NULL,
	[CorporateYear] [char](4) NOT NULL,
	[CorporatePeriod] [char](2) NOT NULL,
	[CalPer] [char](3) NOT NULL,
 CONSTRAINT [PK_DatesPeriod] PRIMARY KEY CLUSTERED 
(
	[PeriodID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[DATESPeriod] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[DATESPeriodTemp]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DATESPeriodTemp]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[DATESPeriodTemp](
	[Dates] [datetime] NOT NULL,
	[FiscalDatepattern] [char](1) NOT NULL,
	[localYear] [char](4) NOT NULL,
	[LocalPeriod] [char](2) NOT NULL,
	[CorporateYear] [char](4) NOT NULL,
	[CorporatePeriod] [char](2) NOT NULL
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[DATESPeriodTemp] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[F0101]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[F0101]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[F0101](
	[ABAN8] [numeric](8, 0) NOT NULL,
	[ABALKY] [nchar](20) NULL,
	[ABTAX] [nchar](20) NULL,
	[ABALPH] [nchar](40) NULL,
	[ABDC] [nchar](40) NULL,
	[ABMCU] [nchar](12) NULL,
	[ABSIC] [nchar](10) NULL,
	[ABLNGP] [nchar](2) NULL,
	[ABAT1] [nchar](3) NULL,
	[ABCM] [nchar](2) NULL,
	[ABTAXC] [nchar](1) NULL,
	[ABAT2] [nchar](1) NULL,
	[ABAT3] [nchar](1) NULL,
	[ABAT4] [nchar](1) NULL,
	[ABAT5] [nchar](1) NULL,
	[ABATP] [nchar](1) NULL,
	[ABATR] [nchar](1) NULL,
	[ABATPR] [nchar](1) NULL,
	[ABAB3] [nchar](1) NULL,
	[ABATE] [nchar](1) NULL,
	[ABSBLI] [nchar](1) NULL,
	[ABEFTB] [numeric](6, 0) NULL,
	[ABAN81] [numeric](8, 0) NULL,
	[ABAN82] [numeric](8, 0) NULL,
	[ABAN83] [numeric](8, 0) NULL,
	[ABAN84] [numeric](8, 0) NULL,
	[ABAN86] [numeric](8, 0) NULL,
	[ABAN85] [numeric](8, 0) NULL,
	[ABAC01] [nchar](3) NULL,
	[ABAC02] [nchar](3) NULL,
	[ABAC03] [nchar](3) NULL,
	[ABAC04] [nchar](3) NULL,
	[ABAC05] [nchar](3) NULL,
	[ABAC06] [nchar](3) NULL,
	[ABAC07] [nchar](3) NULL,
	[ABAC08] [nchar](3) NULL,
	[ABAC09] [nchar](3) NULL,
	[ABAC10] [nchar](3) NULL,
	[ABAC11] [nchar](3) NULL,
	[ABAC12] [nchar](3) NULL,
	[ABAC13] [nchar](3) NULL,
	[ABAC14] [nchar](3) NULL,
	[ABAC15] [nchar](3) NULL,
	[ABAC16] [nchar](3) NULL,
	[ABAC17] [nchar](3) NULL,
	[ABAC18] [nchar](3) NULL,
	[ABAC19] [nchar](3) NULL,
	[ABAC20] [nchar](3) NULL,
	[ABAC21] [nchar](3) NULL,
	[ABAC22] [nchar](3) NULL,
	[ABAC23] [nchar](3) NULL,
	[ABAC24] [nchar](3) NULL,
	[ABAC25] [nchar](3) NULL,
	[ABAC26] [nchar](3) NULL,
	[ABAC27] [nchar](3) NULL,
	[ABAC28] [nchar](3) NULL,
	[ABAC29] [nchar](3) NULL,
	[ABAC30] [nchar](3) NULL,
	[ABGLBA] [nchar](8) NULL,
	[ABPTI] [numeric](6, 0) NULL,
	[ABPDI] [numeric](6, 0) NULL,
	[ABMSGA] [nchar](1) NULL,
	[ABRMK] [nchar](30) NULL,
	[ABTXCT] [nchar](20) NULL,
	[ABTX2] [nchar](20) NULL,
	[ABALP1] [nchar](40) NULL,
	[ABURCD] [nchar](2) NULL,
	[ABURDT] [numeric](6, 0) NULL,
	[ABURAT] [decimal](15, 0) NULL,
	[ABURAB] [numeric](8, 0) NULL,
	[ABURRF] [nchar](15) NULL,
	[ABUSER] [nchar](10) NULL,
	[ABPID] [nchar](10) NULL,
	[ABUPMJ] [numeric](6, 0) NULL,
	[ABJOBN] [nchar](10) NULL,
	[ABUPMT] [numeric](6, 0) NULL,
	[ABPRGF] [nchar](1) NULL,
	[ABSCCLTP] [nchar](2) NULL,
	[ABTICKER] [nchar](10) NULL,
	[ABEXCHG] [nchar](10) NULL,
	[ABDUNS] [nchar](13) NULL,
	[ABCLASS01] [nchar](3) NULL,
	[ABCLASS02] [nchar](3) NULL,
	[ABCLASS03] [nchar](3) NULL,
	[ABCLASS04] [nchar](3) NULL,
	[ABCLASS05] [nchar](3) NULL,
	[ABNOE] [decimal](15, 0) NULL,
	[ABGROWTHR] [decimal](8, 0) NULL,
	[ABYEARSTAR] [nchar](15) NULL,
	[ABAEMPGP] [nchar](5) NULL,
	[ABACTIN] [nchar](1) NULL,
	[ABREVRNG] [nchar](5) NULL,
	[ABSYNCS] [numeric](2, 0) NULL,
	[ABPERRS] [numeric](2, 0) NULL,
	[ABCAAD] [numeric](2, 0) NULL,
 CONSTRAINT [PK_F0101] PRIMARY KEY CLUSTERED 
(
	[ABAN8] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[F0101] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[F570151]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[F570151]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[F570151](
	[OSAN8] [numeric](8, 0) NOT NULL,
	[OSAN8CM01] [decimal](8, 0) NULL,
	[OSDL01] [nchar](30) NULL,
	[OSAN8CM02] [decimal](8, 0) NULL,
	[OSDL02] [nchar](30) NULL,
	[OSAN8CM03] [decimal](8, 0) NULL,
	[OSDL03] [nchar](30) NULL,
	[OSAN8CM04] [decimal](8, 0) NULL,
	[OSDL04] [nchar](30) NULL,
	[OSAN8CM05] [decimal](8, 0) NULL,
	[OSDL05] [nchar](30) NULL,
	[OSAN8CM06] [decimal](8, 0) NULL,
	[OSDL06] [nchar](30) NULL,
	[OSAN8CM07] [decimal](8, 0) NULL,
	[OSDL07] [nchar](30) NULL,
	[OSAN8CM08] [decimal](8, 0) NULL,
	[OSDL08] [nchar](30) NULL,
	[OSAN8CM09] [decimal](8, 0) NULL,
	[OSDL09] [nchar](30) NULL,
	[OSAN8CM10] [decimal](8, 0) NULL,
	[OSDL10] [nchar](30) NULL,
	[OSAN8CM11] [decimal](8, 0) NULL,
	[OSDL11] [nchar](30) NULL,
	[OSAN8CM12] [decimal](8, 0) NULL,
	[OSDL12] [nchar](30) NULL,
	[OSAN8CM13] [decimal](8, 0) NULL,
	[OSDL13] [nchar](30) NULL,
	[OSAN8CM14] [decimal](8, 0) NULL,
	[OSDL14] [nchar](30) NULL,
	[OSAN8CM15] [decimal](8, 0) NULL,
	[OSDL15] [nchar](30) NULL,
	[OSAN8CM16] [decimal](8, 0) NULL,
	[OSDL16] [nchar](30) NULL,
	[OSAN8CM17] [decimal](8, 0) NULL,
	[OSDL17] [nchar](30) NULL,
	[OSAN8CM18] [decimal](8, 0) NULL,
	[OSDL18] [nchar](30) NULL,
	[OSAN8CM19] [decimal](8, 0) NULL,
	[OSDL19] [nchar](30) NULL,
	[OSAN8CM20] [decimal](8, 0) NULL,
	[OSDL20] [nchar](30) NULL,
	[OSANSM01] [numeric](8, 0) NULL,
	[OSDL21] [nchar](30) NULL,
	[OSANSM02] [numeric](8, 0) NULL,
	[OSDL22] [nchar](30) NULL,
	[OSANSM03] [numeric](8, 0) NULL,
	[OSDL23] [nchar](30) NOT NULL,
	[OSANSM04] [numeric](8, 0) NOT NULL,
	[OSDL24] [nchar](30) NOT NULL,
	[OSANSM05] [numeric](8, 0) NOT NULL,
	[OSDL25] [nchar](30) NOT NULL,
	[OSANSM06] [numeric](8, 0) NOT NULL,
	[OSDL26] [nchar](30) NOT NULL,
	[OSANSM07] [numeric](8, 0) NULL,
	[OSDL27] [nchar](30) NULL,
	[OSANSM08] [numeric](8, 0) NULL,
	[OSDL28] [nchar](30) NULL,
	[OSANSM09] [numeric](8, 0) NULL,
	[OSDL29] [nchar](30) NOT NULL,
	[OSANSM10] [numeric](8, 0) NOT NULL,
	[OSDL30] [nchar](30) NOT NULL,
	[OSUSER] [nchar](10) NOT NULL,
	[OSPID] [nchar](10) NOT NULL,
	[OSJOBN] [nchar](10) NOT NULL,
	[OSUPMJ] [numeric](6, 0) NOT NULL,
	[OSTDAY] [decimal](6, 0) NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[OSAN8] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[F570151] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[FBCCustomerMasterCommissioninfo]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FBCCustomerMasterCommissioninfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FBCCustomerMasterCommissioninfo](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[CommissionLineNumber] [int] NOT NULL,
	[Salesperson1] [int] NOT NULL,
	[SalespersonCommission1] [decimal](20, 7) NOT NULL,
	[FlatCommissionAmount] [decimal](20, 7) NOT NULL,
	[AmountPerUnit] [decimal](20, 7) NOT NULL,
	[CommissionCodeType] [char](1) NOT NULL,
	[OwnerFlag] [char](1) NOT NULL,
	[Role] [char](5) NOT NULL,
	[SalesTeamBeginEffectiveDate] [datetime] NOT NULL,
	[SalesTeamEndEffectiveDate] [datetime] NOT NULL,
	[CommissionsYN] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[MachineKey] [char](15) NOT NULL,
	[EnteredBy] [int] NOT NULL,
	[DateEntered] [datetime] NOT NULL,
	[UpdatedDateTime] [datetime] NOT NULL,
	[ProgramId] [char](10) NOT NULL,
	[VersionId] [char](10) NOT NULL,
	[EffectiveSalesPerson] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_FBCCustomerMasterCommissioninfo] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[CompanyNumber] ASC,
	[CommissionLineNumber] ASC,
	[Salesperson1] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[FBCCustomerMasterCommissioninfo] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[FBSalesOrganizationStructure]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FBSalesOrganizationStructure]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[FBSalesOrganizationStructure](
	[AddressNumber] [int] NOT NULL,
	[OperationLevel01] [int] NOT NULL,
	[OperationLevelDesc01] [char](40) NOT NULL,
	[OperationLevel02] [int] NOT NULL,
	[OperationLevelDesc02] [char](40) NOT NULL,
	[OperationLevel03] [int] NOT NULL,
	[OperationLevelDesc03] [char](40) NOT NULL,
	[OperationLevel04] [int] NOT NULL,
	[OperationLevelDesc04] [char](40) NOT NULL,
	[OperationLevel05] [int] NOT NULL,
	[OperationLevelDesc05] [char](40) NOT NULL,
	[OperationLevel06] [int] NOT NULL,
	[OperationLevelDesc06] [char](40) NOT NULL,
	[OperationLevel07] [int] NOT NULL,
	[OperationLevelDesc07] [char](40) NOT NULL,
	[OperationLevel08] [int] NOT NULL,
	[OperationLevelDesc08] [char](40) NOT NULL,
	[OperationLevel09] [int] NOT NULL,
	[OperationLevelDesc09] [char](40) NOT NULL,
	[OperationLevel10] [int] NOT NULL,
	[OperationLevelDesc10] [char](40) NOT NULL,
	[SalesLevel01] [int] NOT NULL,
	[SalesLevelDesc00] [char](40) NOT NULL,
	[SalesLevel02] [int] NOT NULL,
	[SalesLevelDesc02] [char](40) NOT NULL,
	[SalesLevel03] [int] NOT NULL,
	[SalesLevelDesc03] [char](40) NOT NULL,
	[SalesLevel04] [int] NOT NULL,
	[SalesLevelDesc04] [char](40) NOT NULL,
	[SalesLevel05] [int] NOT NULL,
	[SalesLevelDesc05] [char](40) NOT NULL,
	[SalesLevel06] [int] NOT NULL,
	[SalesLevelDesc06] [char](40) NOT NULL,
	[SalesLevel07] [int] NOT NULL,
	[SalesLevelDesc07] [char](40) NOT NULL,
	[SalesLevel08] [int] NOT NULL,
	[SalesLevelDesc08] [char](40) NOT NULL,
	[SalesLevel09] [int] NOT NULL,
	[SalesLevelDesc09] [char](40) NOT NULL,
	[SalesLevel10] [int] NOT NULL,
	[SalesLevelDesc10] [char](40) NOT NULL,
	[NAM01] [int] NOT NULL,
	[NAMDesc01] [char](40) NOT NULL,
	[NAM02] [int] NOT NULL,
	[NAMDesc02] [char](40) NOT NULL,
	[NAM03] [int] NOT NULL,
	[NAMDesc03] [char](40) NOT NULL,
	[NAM04] [int] NOT NULL,
	[NAMDesc04] [char](40) NOT NULL,
	[NAM05] [int] NOT NULL,
	[NAMDesc05] [char](40) NOT NULL,
	[NAM06] [int] NOT NULL,
	[NAMDesc06] [char](40) NOT NULL,
	[NAM07] [int] NOT NULL,
	[NAMDesc07] [char](40) NOT NULL,
	[NAM08] [int] NOT NULL,
	[NAMDesc08] [char](40) NOT NULL,
	[NAM09] [int] NOT NULL,
	[NAMDesc09] [char](40) NOT NULL,
	[NAM00] [int] NOT NULL,
	[NAMDesc10] [char](40) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeofDay] [decimal](6, 0) NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[FBSalesOrganizationStructure] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[Holidays]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Holidays]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Holidays](
	[Holiday] [datetime] NOT NULL,
 CONSTRAINT [PK_Holidays] PRIMARY KEY CLUSTERED 
(
	[Holiday] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[Holidays] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEABAddressBookAddressByDate]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEABAddressBookAddressByDate]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEABAddressBookAddressByDate](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[EffectiveFromDate] [char](1) NOT NULL,
	[AddressLine1] [char](40) NOT NULL,
	[AddressLine2] [char](40) NOT NULL,
	[AddressLine3] [char](40) NOT NULL,
	[AddressLine4] [char](40) NOT NULL,
	[PostalCode] [char](12) NOT NULL,
	[City] [char](25) NOT NULL,
	[County] [char](25) NOT NULL,
	[StateCode] [char](3) NOT NULL,
	[State] [char](30) NOT NULL,
	[CarrierRoute] [char](4) NOT NULL,
	[BulkMailingCenter] [char](2) NOT NULL,
	[CountryCode] [char](3) NOT NULL,
	[Country] [char](30) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[SynchronizationStatus] [int] NOT NULL,
	[ServerStatus] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEABAddressBookAddressByDate] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[StartEffectiveDate] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEABAddressBookAddressByDate] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEABAddressBookMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEABAddressBookMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEABAddressBookMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[LongAddressNumber] [char](20) NOT NULL,
	[TaxID] [char](20) NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[DescriptionCompressed] [char](40) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[StandardIndustryCode] [char](10) NOT NULL,
	[LanguagePreferenceCode] [char](2) NOT NULL,
	[LanguagePreference] [char](30) NOT NULL,
	[SearchTypeCode] [char](3) NOT NULL,
	[SearchType] [char](30) NOT NULL,
	[CreditMessageCode] [char](2) NOT NULL,
	[CreditMessage] [char](30) NOT NULL,
	[PersonCorpTaxpayerCode] [char](1) NOT NULL,
	[ARAPNetting] [char](1) NOT NULL,
	[AddressType3YN] [char](1) NOT NULL,
	[AddressType4YN] [char](1) NOT NULL,
	[AddressType5YN] [char](1) NOT NULL,
	[Payables] [char](1) NOT NULL,
	[Receivables] [char](1) NOT NULL,
	[UserCode] [char](1) NOT NULL,
	[MiscCode3] [char](1) NOT NULL,
	[Employee] [char](1) NOT NULL,
	[SubledgerInactiveCode] [char](1) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[RelatedAddressNumber1] [int] NOT NULL,
	[RelatedAddressNumber2] [int] NOT NULL,
	[RelatedAddressNumber3] [int] NOT NULL,
	[RelatedAddressNumber4] [int] NOT NULL,
	[RelatedAddressNumber5] [int] NOT NULL,
	[FactorSpecialPayee] [int] NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[Category11Code] [char](3) NOT NULL,
	[Category11] [char](30) NOT NULL,
	[Category12Code] [char](3) NOT NULL,
	[Category12] [char](30) NOT NULL,
	[Category13Code] [char](3) NOT NULL,
	[Category13] [char](30) NOT NULL,
	[Category14Code] [char](3) NOT NULL,
	[Category14] [char](30) NOT NULL,
	[Category15Code] [char](3) NOT NULL,
	[Category15] [char](30) NOT NULL,
	[Category16Code] [char](3) NOT NULL,
	[Category16] [char](30) NOT NULL,
	[Category17Code] [char](3) NOT NULL,
	[Category17] [char](30) NOT NULL,
	[Category18Code] [char](3) NOT NULL,
	[Category18] [char](30) NOT NULL,
	[Category19Code] [char](3) NOT NULL,
	[Category19] [char](30) NOT NULL,
	[Category20Code] [char](3) NOT NULL,
	[Category20] [char](30) NOT NULL,
	[Category21Code] [char](3) NOT NULL,
	[Category21] [char](30) NOT NULL,
	[Category22Code] [char](3) NOT NULL,
	[Category22] [char](30) NOT NULL,
	[Category23Code] [char](3) NOT NULL,
	[Category23] [char](30) NOT NULL,
	[Category24Code] [char](3) NOT NULL,
	[Category24] [char](30) NOT NULL,
	[Category25Code] [char](3) NOT NULL,
	[Category25] [char](30) NOT NULL,
	[Category26Code] [char](3) NOT NULL,
	[Category26] [char](30) NOT NULL,
	[Category27Code] [char](3) NOT NULL,
	[Category27] [char](30) NOT NULL,
	[Category28Code] [char](3) NOT NULL,
	[Category28] [char](30) NOT NULL,
	[Category29Code] [char](3) NOT NULL,
	[Category29] [char](30) NOT NULL,
	[Category30Code] [char](3) NOT NULL,
	[Category30] [char](30) NOT NULL,
	[GLBankAccount] [char](8) NOT NULL,
	[TimeScheduledIn] [int] NOT NULL,
	[DateScheduledIn] [datetime] NOT NULL,
	[MessageClearedYN] [char](1) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[Certificate] [char](20) NOT NULL,
	[EuropeanIndividualTaxID] [char](20) NOT NULL,
	[SecondaryAlphaName] [char](40) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[PurgeFlag] [char](1) NOT NULL,
	[ShortcutClientType] [char](2) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[Ticker] [char](10) NOT NULL,
	[StockExchange] [char](10) NOT NULL,
	[DUNSNumber] [char](13) NOT NULL,
	[Classification01Code] [char](3) NOT NULL,
	[Classification01] [char](30) NOT NULL,
	[Classification02Code] [char](3) NOT NULL,
	[Classification02] [char](30) NOT NULL,
	[Classification03Code] [char](3) NOT NULL,
	[Classification03] [char](30) NOT NULL,
	[Classification04Code] [char](3) NOT NULL,
	[Classification04] [char](30) NOT NULL,
	[Classification05Code] [char](3) NOT NULL,
	[Classification05] [char](30) NOT NULL,
	[NumberOfEmployees] [int] NOT NULL,
	[GrowthRate] [int] NOT NULL,
	[YearStarted] [char](15) NOT NULL,
	[EmployeeGroupApprovals] [char](5) NOT NULL,
	[FutureUseIndicator] [char](1) NOT NULL,
	[RevenueRange] [char](5) NOT NULL,
	[SynchronizationStatus] [int] NOT NULL,
	[PreviousErrorStatus] [int] NOT NULL,
	[ServerStatus] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEABAddressBookMaster] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEABAddressBookMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEABAddressBookOrgStructure]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEABAddressBookOrgStructure]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEABAddressBookOrgStructure](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[StructureType] [char](3) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[DisplaySequence] [decimal](20, 7) NOT NULL,
	[BeginningEffectiveDate] [datetime] NOT NULL,
	[EndingEffectiveDate] [datetime] NOT NULL,
	[Remark] [char](30) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[SynchronizationStatus] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEABAddressBookOrgStructure] PRIMARY KEY CLUSTERED 
(
	[ParentNumber] ASC,
	[AddressNumber] ASC,
	[StructureType] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEABAddressBookOrgStructure] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEABAddressBookWhosWho]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEABAddressBookWhosWho]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEABAddressBookWhosWho](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[WhosWhoLine] [decimal](20, 7) NOT NULL,
	[DisplaySequence] [decimal](20, 7) NOT NULL,
	[MailingName] [char](40) NOT NULL,
	[ProfessionalTitle] [char](40) NOT NULL,
	[Remark01] [char](40) NOT NULL,
	[SalutationName] [char](40) NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[DescriptionCompressed] [char](40) NOT NULL,
	[GivenName] [char](25) NOT NULL,
	[MiddleName] [char](25) NOT NULL,
	[SurName] [char](25) NOT NULL,
	[TypeCode] [char](1) NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[SecondaryMailingName] [char](40) NOT NULL,
	[SecondaryAlphaName] [char](40) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[ContactType] [char](3) NOT NULL,
	[Nickname] [char](40) NOT NULL,
	[Gender] [char](1) NOT NULL,
	[DayOfBirth] [int] NOT NULL,
	[MonthOfBirth] [int] NOT NULL,
	[YearOfBirth] [int] NOT NULL,
	[Category01CodeContact] [char](3) NOT NULL,
	[Category01Contact] [char](30) NOT NULL,
	[Category02CodeContact] [char](3) NOT NULL,
	[Category02Contact] [char](30) NOT NULL,
	[Category03CodeContact] [char](3) NOT NULL,
	[Category03Contact] [char](30) NOT NULL,
	[Category04CodeContact] [char](3) NOT NULL,
	[Category04Contact] [char](30) NOT NULL,
	[Category05CodeContact] [char](3) NOT NULL,
	[Category05Contact] [char](30) NOT NULL,
	[Category06CodeContact] [char](3) NOT NULL,
	[Category06Contact] [char](30) NOT NULL,
	[Category07CodeContact] [char](3) NOT NULL,
	[Category07Contact] [char](30) NOT NULL,
	[Category08CodeContact] [char](3) NOT NULL,
	[Category08Contact] [char](30) NOT NULL,
	[Category09CodeContact] [char](3) NOT NULL,
	[Category09Contact] [char](30) NOT NULL,
	[Category10CodeContact] [char](3) NOT NULL,
	[Category10Contact] [char](30) NOT NULL,
	[FunctionCode] [char](10) NOT NULL,
	[PreferredContactMethod] [char](10) NOT NULL,
	[PrimaryContact] [char](3) NOT NULL,
	[FutureUseIndicator] [char](1) NOT NULL,
	[UniqueIdentifier] [char](36) NOT NULL,
	[SynchronizationStatus] [int] NOT NULL,
	[ServerStatus] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEABAddressBookWhosWho] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[WhosWhoLine] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEABAddressBookWhosWho] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEABTierDescriptions]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEABTierDescriptions]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEABTierDescriptions](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[TierType] [char](3) NOT NULL,
	[TierLevel] [int] NOT NULL,
	[TierDescription] [char](40) NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[ExpirationDate] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [char](10) NOT NULL,
	[InsertDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEABTierDescriptions] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[TierType] ASC,
	[TierLevel] ASC,
	[EffectiveDate] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEABTierDescriptions] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEAPLedger]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEAPLedger]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEAPLedger](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[PayItem] [char](3) NOT NULL,
	[PayItemExtensionNumber] [int] NOT NULL,
	[AdjustingDocumentType] [char](2) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PayeeAddressNumber] [int] NOT NULL,
	[ApproverNumber] [int] NOT NULL,
	[InvoiceDate] [datetime] NOT NULL,
	[ServiceDateTax] [datetime] NOT NULL,
	[DueDate] [datetime] NOT NULL,
	[DiscountDueDate] [datetime] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[Century] [int] NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchType] [char](2) NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[BalancedJE] [char](1) NOT NULL,
	[PayStatus] [char](1) NOT NULL,
	[GrossAmount] [decimal](20, 7) NOT NULL,
	[OpenAmount] [decimal](20, 7) NOT NULL,
	[DiscountAvailable] [decimal](20, 7) NOT NULL,
	[DiscountTaken] [decimal](20, 7) NOT NULL,
	[TaxableAmount] [decimal](20, 7) NOT NULL,
	[NonTaxableAmount] [decimal](20, 7) NOT NULL,
	[TaxAmount] [decimal](20, 7) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[CurrencyAmount] [decimal](20, 7) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[ForeignDiscountAvailable] [decimal](20, 7) NOT NULL,
	[ForeignDiscountTaken] [decimal](20, 7) NOT NULL,
	[ForeignTaxableAmount] [decimal](20, 7) NOT NULL,
	[ForeignNonTaxableAmount] [decimal](20, 7) NOT NULL,
	[ForeignTaxAmount] [decimal](20, 7) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[GLBankAccount] [char](8) NOT NULL,
	[GLPostedCode] [char](1) NOT NULL,
	[AccountMode01] [char](1) NOT NULL,
	[GLCreditAccountID] [char](8) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[BankTransitShortID] [char](8) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[VoidFlag] [char](1) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalDocumentType] [char](2) NOT NULL,
	[OriginalDocumentNumber] [int] NOT NULL,
	[OriginalPayItem] [char](3) NOT NULL,
	[PaymentHandlingCode] [char](3) NOT NULL,
	[InvoiceNumber] [char](25) NOT NULL,
	[PurchaseOrderDocumentCompany] [char](5) NOT NULL,
	[PONumber] [char](8) NOT NULL,
	[PurchaseOrderDocumentType] [char](2) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[OperationsSequenceNumber] [decimal](20, 7) NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[UnitNumber] [char](8) NOT NULL,
	[AssetBusinessUnit] [char](12) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[RecurFrequency] [char](2) NOT NULL,
	[NumberOfPayments] [int] NOT NULL,
	[StatementNumber] [char](13) NOT NULL,
	[ClosedStatement] [char](1) NOT NULL,
	[Units] [decimal](20, 7) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[TaxArea3Withholding] [char](10) NOT NULL,
	[TaxExplCode3Withholding] [char](2) NOT NULL,
	[MiscellaneousCode01] [char](1) NOT NULL,
	[MiscellaneousCode02] [char](1) NOT NULL,
	[CashRcptsInvRegCode] [char](1) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[FlagFor1099] [char](1) NOT NULL,
	[DomesticEntryWMultiCurrDistr] [char](1) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[HistoricalExchangeRate] [decimal](20, 7) NOT NULL,
	[HistoricalDate] [datetime] NOT NULL,
	[UserReservedCode] [char](3) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [decimal](6, 0) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[TransitNumberBank] [char](20) NOT NULL,
	[CategoryCodeAPLedger01] [char](3) NOT NULL,
	[CategoryCodeAPLedger02] [char](3) NOT NULL,
	[CategoryCodeAPLedger03] [char](3) NOT NULL,
	[CategoryCodeAPLedger04] [char](3) NOT NULL,
	[CategoryCodeAPLedger05] [char](3) NOT NULL,
	[CategoryCodeAPLedger06] [char](3) NOT NULL,
	[CategoryCodeAPLedger07] [char](3) NOT NULL,
	[CategoryCodeAPLedger08] [char](3) NOT NULL,
	[CategoryCodeAPLedger09] [char](3) NOT NULL,
	[CategoryCodeAPLedger10] [char](3) NOT NULL,
	[DeferredTaxStatusVAT] [char](1) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[AmountToDistribute] [decimal](20, 7) NOT NULL,
	[AmountCurrencyToDistribute] [decimal](20, 7) NOT NULL,
	[NonRecoverableTaxAmount] [decimal](20, 7) NOT NULL,
	[ForeignNonRecoverableTax] [decimal](20, 7) NOT NULL,
	[PurchasingTaxableYN] [char](1) NOT NULL,
	[PurgeFlag] [char](1) NOT NULL,
	[GenericFlag5] [char](1) NOT NULL,
	[GenericFlag6] [char](1) NOT NULL,
	[GenericAmount1] [decimal](20, 7) NOT NULL,
	[GenericAmount2] [decimal](20, 7) NOT NULL,
	[GenericString4] [char](25) NOT NULL,
	[GenericString5] [char](25) NOT NULL,
	[FutureWithholdTaxAmtDomestic] [decimal](20, 7) NOT NULL,
	[FutureWithholdTaxAmtForeign] [decimal](20, 7) NOT NULL,
	[SummarizedFlag] [char](1) NOT NULL,
	[PayWhenPaid] [char](1) NOT NULL,
	[PayWhenPaidGroupNumber] [int] NOT NULL,
	[NettingTransactionID] [int] NOT NULL,
	[NettingDocumentNumber] [int] NOT NULL,
	[NettingLineID] [int] NOT NULL,
	[NettingStatusCode] [char](1) NOT NULL,
	[ContractID] [int] NOT NULL,
	[ContractCode] [char](12) NOT NULL,
	[HarvestID] [int] NOT NULL,
	[BlockCode] [char](10) NOT NULL,
	[HarvestPeriod] [char](6) NOT NULL,
	[HarvestSuffix] [char](10) NOT NULL,
	[DueDateRule] [char](5) NOT NULL,
	[SequenceNumber] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEAPLedger] PRIMARY KEY CLUSTERED 
(
	[DocumentNumber] ASC,
	[DocumentCompany] ASC,
	[DocumentType] ASC,
	[PayItem] ASC,
	[PayItemExtensionNumber] ASC,
	[AddressNumber] ASC,
	[AdjustingDocumentType] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEAPLedger] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEAPMatchingDocumentDetail]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEAPMatchingDocumentDetail]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEAPMatchingDocumentDetail](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[InternalPaymentID] [decimal](15, 0) NOT NULL,
	[FileLineIdentifier] [int] NOT NULL,
	[PaymentItemDocumentType] [char](2) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[PayItem] [char](3) NOT NULL,
	[PayItemExtensionNumber] [int] NOT NULL,
	[PaymentAmount] [decimal](20, 7) NOT NULL,
	[DiscountAvailable] [decimal](20, 7) NOT NULL,
	[DiscountTaken] [decimal](20, 7) NOT NULL,
	[PaymentAmountForeign] [decimal](20, 7) NOT NULL,
	[ForeignDiscountAvailable] [decimal](20, 7) NOT NULL,
	[ForeignDiscountTaken] [decimal](20, 7) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[GLPostedCode] [char](1) NOT NULL,
	[CashBasisAccountingPostCode] [char](1) NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[Century] [int] NOT NULL,
	[ClosedStatement] [char](1) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[PONumber] [char](8) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[HistoricalExchangeRate] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[CurrencyCodeBase] [char](6) NOT NULL,
	[LocalizationReservedFlag] [char](2) NOT NULL,
	[PositivePayFlag] [char](2) NOT NULL,
	[GenericFlag8] [char](2) NOT NULL,
	[GenericAmount3] [decimal](20, 7) NOT NULL,
	[GenericAmount4] [decimal](20, 7) NOT NULL,
	[GenericString6] [char](50) NOT NULL,
	[GenericString7] [char](50) NOT NULL,
	[DiscountReasonCode] [char](6) NOT NULL,
	[NettingTransactionID] [int] NOT NULL,
	[NettingDocumentNumber] [int] NOT NULL,
	[NettingLineID] [int] NOT NULL,
	[ContractID] [int] NOT NULL,
	[ContractCode] [char](12) NOT NULL,
	[HarvestID] [int] NOT NULL,
	[BlockCode] [char](10) NOT NULL,
	[HarvestPeriod] [char](6) NOT NULL,
	[HarvestSuffix] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEAPMatchingDocumentDetail] PRIMARY KEY CLUSTERED 
(
	[InternalPaymentID] ASC,
	[FileLineIdentifier] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEAPMatchingDocumentDetail] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEAPMatchingDocumentHeader]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEAPMatchingDocumentHeader]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEAPMatchingDocumentHeader](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[InternalPaymentID] [decimal](15, 0) NOT NULL,
	[PaymentItemDocumentType] [char](2) NOT NULL,
	[PayItemNumber] [int] NOT NULL,
	[PayeeAddressNumber] [int] NOT NULL,
	[GLBankAccount] [char](8) NOT NULL,
	[CheckItemDate] [datetime] NOT NULL,
	[GLVoidDate] [datetime] NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchType] [char](2) NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[PaymentAmount] [decimal](20, 7) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[AccountMode01] [char](1) NOT NULL,
	[ClearedValueDate] [datetime] NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[PaymentsPostStatus] [char](1) NOT NULL,
	[CustomerBankAccountNumber] [char](20) NOT NULL,
	[BankTapeReconcilliationRef] [char](8) NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[MulticurrencyIntercompanyPay] [char](2) NOT NULL,
	[LocalizationReservedFlag] [char](2) NOT NULL,
	[PurgeFlag] [char](2) NOT NULL,
	[PositivePayFlag] [char](2) NOT NULL,
	[GenericFlag8] [char](2) NOT NULL,
	[GenericAmount3] [decimal](20, 7) NOT NULL,
	[GenericAmount4] [decimal](20, 7) NOT NULL,
	[GenericString6] [char](50) NOT NULL,
	[GenericString7] [char](50) NOT NULL,
	[NettingTransactionID] [int] NOT NULL,
	[NettingDocumentNumber] [int] NOT NULL,
	[ReconciledCode] [char](1) NOT NULL,
	[Ref3AccountReconciliation] [char](8) NOT NULL,
	[ContractID] [int] NOT NULL,
	[ContractCode] [char](12) NOT NULL,
	[HarvestID] [int] NOT NULL,
	[BlockCode] [char](10) NOT NULL,
	[HarvestPeriod] [char](6) NOT NULL,
	[HarvestSuffix] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEAPMatchingDocumentHeader] PRIMARY KEY CLUSTERED 
(
	[InternalPaymentID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEAPMatchingDocumentHeader] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEAPSupplierMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEAPSupplierMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEAPSupplierMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[GLClass] [char](4) NOT NULL,
	[BusinessUnitAPDefault] [char](12) NOT NULL,
	[ObjectAccountsPayableDefault] [char](6) NOT NULL,
	[SubsidiaryAccountsPayableDef] [char](8) NOT NULL,
	[DocumentCompanyAPModelDocument] [char](5) NOT NULL,
	[DocumentAPDefaultforModelJE] [int] NOT NULL,
	[DocumentTypeAPDefaultModelJE] [char](2) NOT NULL,
	[CurrencyCodeAccountsPayable] [char](3) NOT NULL,
	[TaxRateArea2] [char](10) NOT NULL,
	[TaxExplCode2] [char](2) NOT NULL,
	[HoldPaymentCode] [char](1) NOT NULL,
	[TaxArea3Withholding] [char](10) NOT NULL,
	[TaxExplCode3Withholding] [char](2) NOT NULL,
	[TaxAuthorityforAPWithholding] [int] NOT NULL,
	[WithholdingPercent] [decimal](20, 7) NOT NULL,
	[PaymentTermsAP] [char](3) NOT NULL,
	[MultiplePayments] [char](1) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[ApproverNumber] [int] NOT NULL,
	[PreNoteCode] [char](1) NOT NULL,
	[FloatDaysforPayments] [int] NOT NULL,
	[LedgerInquirySequence] [char](1) NOT NULL,
	[CurrencyCodeABAmounts] [char](3) NOT NULL,
	[AmountVoucheredYTD] [decimal](20, 7) NOT NULL,
	[AmountVoucheredPYE] [decimal](20, 7) NOT NULL,
	[AddressBookAmount] [decimal](20, 7) NOT NULL,
	[AddressBookAmount01] [decimal](20, 7) NOT NULL,
	[AmountOpenOrder] [decimal](20, 7) NOT NULL,
	[MinimumOrderValue] [decimal](15, 0) NOT NULL,
	[MaximumOrderValue] [decimal](15, 0) NOT NULL,
	[RelatedAddressNumber] [int] NOT NULL,
	[BillingAddressType] [char](1) NOT NULL,
	[CustomerPricingRule] [char](8) NOT NULL,
	[OrderTemplate] [char](8) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[RouteCode] [char](3) NOT NULL,
	[StopCode] [char](3) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[CarrierCode] [int] NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[DeliveryInstructions01] [char](30) NOT NULL,
	[DeliveryInstructions02] [char](30) NOT NULL,
	[LeadTimeTransitDays] [int] NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[InvoiceCopies] [int] NOT NULL,
	[PricePickList] [char](1) NOT NULL,
	[WeightDisplayedUOM] [char](2) NOT NULL,
	[VolumeDisplayedUOM] [char](2) NOT NULL,
	[PurchasingCategory05Code] [char](3) NOT NULL,
	[BatchProcessingMode] [char](1) NOT NULL,
	[CustomerTypeIdentifier] [char](1) NOT NULL,
	[ItemTypeIdentifier] [char](1) NOT NULL,
	[QuantityDecimals] [int] NOT NULL,
	[AmountDecimals] [int] NOT NULL,
	[FutureUse01] [char](1) NOT NULL,
	[FutureUse02] [char](1) NOT NULL,
	[SupplierParentRebatelevel] [char](1) NOT NULL,
	[SupplierRebateCode] [char](1) NOT NULL,
	[SpecialInstruction03] [char](1) NOT NULL,
	[SpecialInstruction04] [char](1) NOT NULL,
	[SpecialInstruction05] [char](1) NOT NULL,
	[MinimumCheckAmountCode] [char](1) NOT NULL,
	[Owner] [char](1) NOT NULL,
	[RevenueNettedYN] [char](1) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[EvaluatedReceipt] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEAPSupplierMaster] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEAPSupplierMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEARCMbyLineofBusines]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEARCMbyLineofBusines]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEARCMbyLineofBusines](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[ARClass] [char](4) NOT NULL,
	[ARDefaultBU] [char](12) NOT NULL,
	[ARDefaultObject] [char](6) NOT NULL,
	[ARDefaultSubsidiary] [char](8) NOT NULL,
	[ARModelDocumentCo] [char](5) NOT NULL,
	[ARModelJEDocument] [int] NOT NULL,
	[ARModelJEDocumentType] [char](2) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[CreditLimit] [decimal](15, 0) NOT NULL,
	[HoldInvoices] [char](1) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[SendStatementTo] [char](1) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[PrintStatements] [char](1) NOT NULL,
	[AlternatePayer] [int] NOT NULL,
	[AutoCash] [char](1) NOT NULL,
	[SendInvoiceTo] [char](1) NOT NULL,
	[LedgerInquirySequence] [char](1) NOT NULL,
	[AutoCashAlgorithm] [char](2) NOT NULL,
	[StatementCycle] [char](2) NOT NULL,
	[BalanceForwardOpenItem] [char](1) NOT NULL,
	[TemporaryCreditMessage] [char](2) NOT NULL,
	[CreditCheckHandlingCode] [char](1) NOT NULL,
	[DateOfLastCreditReview] [datetime] NOT NULL,
	[DelinquencyNotice] [char](1) NOT NULL,
	[LastReviewedBy] [char](10) NOT NULL,
	[RecallForReviewByDate] [datetime] NOT NULL,
	[DaysSalesOutstanding] [int] NOT NULL,
	[CreditManager] [char](10) NOT NULL,
	[CollectionManager] [char](10) NOT NULL,
	[NoOfDunningLettersSent] [int] NOT NULL,
	[LastDunningLetterDate] [datetime] NOT NULL,
	[NumberOfRemindersToSend] [char](1) NOT NULL,
	[CollectionReport] [char](1) NOT NULL,
	[NumberOfSentReminders01] [int] NOT NULL,
	[NumberOfSentReminders02] [int] NOT NULL,
	[NumberOfSentReminders03] [int] NOT NULL,
	[NumberOfInvoicesToCollection] [int] NOT NULL,
	[ApplyFinanceCharges] [char](1) NOT NULL,
	[ApplyFinanceChargeDays] [int] NOT NULL,
	[PercentageFactor] [decimal](20, 7) NOT NULL,
	[CreateFinanceChargeEntries] [char](1) NOT NULL,
	[MiscCode02] [char](1) NOT NULL,
	[LastStatementDate] [datetime] NOT NULL,
	[DateOfFirstInvoice] [datetime] NOT NULL,
	[LastInvoiceDate] [datetime] NOT NULL,
	[ABCCodeSales] [char](1) NOT NULL,
	[ABCCodeMargin] [char](1) NOT NULL,
	[ABCCodeAverageDays] [char](1) NOT NULL,
	[FinancialStatementsOnHand] [datetime] NOT NULL,
	[DateLastPaid] [datetime] NOT NULL,
	[DunnAndBradstreetRating] [char](3) NOT NULL,
	[DunnAndBradstreetDate] [datetime] NOT NULL,
	[TRWRating] [char](3) NOT NULL,
	[TRWDate] [datetime] NOT NULL,
	[AverageDaysToPay] [int] NOT NULL,
	[CurrencyCodeABAmounts] [char](3) NOT NULL,
	[AmountDue] [decimal](20, 7) NOT NULL,
	[PriorYearFinanceCharges] [decimal](20, 7) NOT NULL,
	[YTDFinanceCharges] [decimal](20, 7) NOT NULL,
	[AmountInvoicedThisYear] [decimal](20, 7) NOT NULL,
	[AmountInvoicedPriorYear] [decimal](20, 7) NOT NULL,
	[HighBalance] [decimal](20, 7) NOT NULL,
	[LastPaidAmount] [decimal](20, 7) NOT NULL,
	[AddressBookAmount] [decimal](20, 7) NOT NULL,
	[AddressBookAmount01] [decimal](20, 7) NOT NULL,
	[AmountOpenOrder] [decimal](20, 7) NOT NULL,
	[MaximumOrderValue] [decimal](20, 7) NOT NULL,
	[MinimumOrderValue] [decimal](20, 7) NOT NULL,
	[YTDOrders] [int] NOT NULL,
	[PriorYearOrders] [int] NOT NULL,
	[PersonOpeningAccount] [char](10) NOT NULL,
	[DateAccountOpened] [datetime] NOT NULL,
	[RelatedAddressNumber] [int] NOT NULL,
	[BillingAddressType] [char](1) NOT NULL,
	[CustomerPricingRule] [char](8) NOT NULL,
	[OrderTemplate] [char](8) NOT NULL,
	[TradeDiscount] [decimal](20, 7) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[ExemptFromCreditHold] [char](1) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[RouteCode] [char](3) NOT NULL,
	[StopCode] [char](3) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[DeliveryInstructions01] [char](30) NOT NULL,
	[DeliveryInstructions02] [char](30) NOT NULL,
	[LeadTimeTransitDays] [int] NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[ApplyFreightYN] [char](1) NOT NULL,
	[PartialShipmentsAllowed] [char](1) NOT NULL,
	[SubstitutesAllowed] [char](1) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[CustomerPORequired] [char](1) NOT NULL,
	[PriorityProcessingCode] [char](1) NOT NULL,
	[ARCreditCheckLevel] [char](1) NOT NULL,
	[InvoiceCopies] [int] NOT NULL,
	[InvoiceConsolidation] [char](1) NOT NULL,
	[BillingFrequency] [char](1) NOT NULL,
	[NextInvoiceDate] [datetime] NOT NULL,
	[LicenseExpirationDate] [datetime] NOT NULL,
	[PricePickList] [char](1) NOT NULL,
	[MergeOrders] [char](1) NOT NULL,
	[CommissionCode01] [int] NOT NULL,
	[CommissionRate1] [decimal](20, 7) NOT NULL,
	[CommissionCode02] [int] NOT NULL,
	[CommissionRate2] [decimal](20, 7) NOT NULL,
	[PalletControl] [char](1) NOT NULL,
	[VolumeDisplayedUOM] [char](2) NOT NULL,
	[WeightDisplayedUOM] [char](2) NOT NULL,
	[BatchProcessingMode] [char](1) NOT NULL,
	[ItemTypeIdentifier] [char](1) NOT NULL,
	[CustomerTypeIdentifier] [char](1) NOT NULL,
	[QuantityDecimals] [int] NOT NULL,
	[AmountDecimals] [int] NOT NULL,
	[FutureUse01] [char](1) NOT NULL,
	[FutureUse02] [char](1) NOT NULL,
	[PartialOrderShipmentsAllowed] [char](1) NOT NULL,
	[SpecialInstructions02] [char](1) NOT NULL,
	[SpecialInstructions03] [char](1) NOT NULL,
	[SpecialInstructions04] [char](1) NOT NULL,
	[SpecialInstructions05] [char](1) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[ReportCodes] [char](1) NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[AdjustmentsOnInvoice] [char](1) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[PolicyNumberInternal] [int] NOT NULL,
	[DeductionManager] [int] NOT NULL,
	[AutoReceiptsExecutionList] [char](10) NOT NULL,
	[AdministrationCreditLimit] [decimal](15, 0) NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[Category11Code] [char](3) NOT NULL,
	[Category11] [char](30) NOT NULL,
	[Category12Code] [char](3) NOT NULL,
	[Category12] [char](30) NOT NULL,
	[Category13Code] [char](3) NOT NULL,
	[Category13] [char](30) NOT NULL,
	[Category14Code] [char](3) NOT NULL,
	[Category14] [char](30) NOT NULL,
	[Category15Code] [char](3) NOT NULL,
	[Category15] [char](30) NOT NULL,
	[Category16Code] [char](3) NOT NULL,
	[Category16] [char](30) NOT NULL,
	[Category17Code] [char](3) NOT NULL,
	[Category17] [char](30) NOT NULL,
	[Category18Code] [char](3) NOT NULL,
	[Category18] [char](30) NOT NULL,
	[Category19Code] [char](3) NOT NULL,
	[Category19] [char](30) NOT NULL,
	[Category20Code] [char](3) NOT NULL,
	[Category20] [char](30) NOT NULL,
	[Category21Code] [char](3) NOT NULL,
	[Category21] [char](30) NOT NULL,
	[Category22Code] [char](3) NOT NULL,
	[Category22] [char](30) NOT NULL,
	[Category23Code] [char](3) NOT NULL,
	[Category23] [char](30) NOT NULL,
	[Category24Code] [char](3) NOT NULL,
	[Category24] [char](30) NOT NULL,
	[Category25Code] [char](3) NOT NULL,
	[Category25] [char](30) NOT NULL,
	[Category26Code] [char](3) NOT NULL,
	[Category26] [char](30) NOT NULL,
	[Category27Code] [char](3) NOT NULL,
	[Category27] [char](30) NOT NULL,
	[Category28Code] [char](3) NOT NULL,
	[Category28] [char](30) NOT NULL,
	[Category29Code] [char](3) NOT NULL,
	[Category29] [char](30) NOT NULL,
	[Category30Code] [char](3) NOT NULL,
	[Category30] [char](30) NOT NULL,
	[ProgramNameShippingLabels] [char](10) NOT NULL,
	[VersionNameShipLabelProgram] [char](10) NOT NULL,
	[ConfigurationPickandPack] [char](18) NOT NULL,
	[ConfigurationStandCartonPack] [char](18) NOT NULL,
	[DefaultConfiguration] [char](1) NOT NULL,
	[RequiresPackagingCode] [char](1) NOT NULL,
	[RequiresWeightCode] [char](1) NOT NULL,
	[DefaultIdentificationCodeQual1] [char](2) NOT NULL,
	[DefaultIdentificationCodeQual2] [char](2) NOT NULL,
	[RequiresIdentificationCode1] [char](1) NOT NULL,
	[RequiresIdentificationCode2] [char](1) NOT NULL,
	[RequiresTransportationMethod] [char](1) NOT NULL,
	[RequiresRouting] [char](1) NOT NULL,
	[RequiresEquipment] [char](1) NOT NULL,
	[RequiresReferenceNumber1] [char](1) NOT NULL,
	[DefaultReferenceNumQualifier1] [char](2) NOT NULL,
	[DefaultIdentificationCodeQual] [char](2) NOT NULL,
	[RequiresReferenceNumber2] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[PurgeFlag] [char](1) NOT NULL,
	[PreferenceSchedule] [char](8) NOT NULL,
	[OPBusinessObjective] [char](30) NOT NULL,
	[AllowShippingOfHeldLots] [char](1) NOT NULL,
	[BuyingSegmentCode] [char](10) NOT NULL,
	[BypassAuditLogging] [char](30) NOT NULL,
	[APSBusinessUnit] [char](1) NOT NULL,
	[Tier] [char](5) NOT NULL,
	[PayWhenPaidCashReceiptThresh] [int] NOT NULL,
	[CustomerStatus] [char](1) NOT NULL,
	[OverrideSalesTeamAssignment] [char](1) NOT NULL,
	[TerritoryID] [int] NOT NULL,
	[IndustryGroup] [int] NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[DateEntered] [datetime] NOT NULL,
	[SynchronizationStatus] [int] NOT NULL,
	[ServerStatus] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEARCustomerMasterbyLineofBusiness] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[CompanyNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEARCMbyLineofBusines] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEARCustomerMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEARCustomerMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEARCustomerMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ARClass] [char](4) NOT NULL,
	[ARDefaultBU] [char](12) NOT NULL,
	[ARDefaultObject] [char](6) NOT NULL,
	[ARDefaultSubsidiary] [char](8) NOT NULL,
	[ARModelDocumentCo] [char](5) NOT NULL,
	[ARModelJEDocument] [int] NOT NULL,
	[ARModelJEDocumentType] [char](2) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxEplanationCode] [char](2) NOT NULL,
	[CreditLimit] [decimal](20, 7) NOT NULL,
	[HoldInvoices] [char](1) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[AlternatePayer] [int] NOT NULL,
	[SendStatementTo] [char](1) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[PrintStatements] [char](1) NOT NULL,
	[AutoCash] [char](1) NOT NULL,
	[SendInvoiceTo] [char](1) NOT NULL,
	[LedgerInquirySequence] [char](1) NOT NULL,
	[AutoCashAlgorithm] [char](2) NOT NULL,
	[StatementCycle] [char](2) NOT NULL,
	[BalanceForwardOpenItem] [char](1) NOT NULL,
	[TemporaryCreditMessage] [char](2) NOT NULL,
	[CreditCheckHandlingCode] [char](1) NOT NULL,
	[DateOfLastCreditReview] [datetime] NOT NULL,
	[DelinquencyNotice] [char](1) NOT NULL,
	[LastReviewedBy] [char](10) NOT NULL,
	[RecallForReviewByDate] [datetime] NOT NULL,
	[DaysSalesOutstanding] [int] NOT NULL,
	[CreditManager] [char](10) NOT NULL,
	[CollectionManager] [char](10) NOT NULL,
	[NoOfDunningLettersSent] [int] NOT NULL,
	[LastDunningLetterDate] [datetime] NOT NULL,
	[NumberOfRemindersToSend] [char](1) NOT NULL,
	[CollectionReport] [char](1) NOT NULL,
	[NumberOfSentReminders01] [int] NOT NULL,
	[NumberOfSentReminders02] [int] NOT NULL,
	[NumberOfSentReminders03] [int] NOT NULL,
	[NumberOfInvoicesToCollection] [int] NOT NULL,
	[ApplyFinanceCharges] [char](1) NOT NULL,
	[ApplyFinanceChargeDays] [int] NOT NULL,
	[PercentageFactor] [decimal](20, 7) NOT NULL,
	[CreateFinanceChargeEntries] [char](1) NOT NULL,
	[MiscCode02] [char](1) NOT NULL,
	[LastStatementDate] [datetime] NOT NULL,
	[DateOfFirstInvoice] [datetime] NOT NULL,
	[LastInvoiceDate] [datetime] NOT NULL,
	[ABCCodeSales] [char](1) NOT NULL,
	[ABCCodeMargin] [char](1) NOT NULL,
	[ABCCodeAverageDays] [char](1) NOT NULL,
	[FinancialStatementsOnHand] [datetime] NOT NULL,
	[DateOfHighBalance] [datetime] NOT NULL,
	[DateLastPaid] [datetime] NOT NULL,
	[DunnAndBradstreetRating] [char](3) NOT NULL,
	[DunnAndBradstreetDate] [datetime] NOT NULL,
	[TRWRating] [char](3) NOT NULL,
	[TRWDate] [datetime] NOT NULL,
	[AverageDaysToPay] [int] NOT NULL,
	[CurrencyCodeABAmounts] [char](3) NOT NULL,
	[AmountDue] [decimal](20, 7) NOT NULL,
	[PriorYearFinanceCharges] [decimal](20, 7) NOT NULL,
	[YTDFinanceCharges] [decimal](20, 7) NOT NULL,
	[AmountInvoicedThisYear] [decimal](20, 7) NOT NULL,
	[AmountInvoicedPriorYear] [decimal](20, 7) NOT NULL,
	[HighBalance] [decimal](20, 7) NOT NULL,
	[LastPaidAmount] [decimal](20, 7) NOT NULL,
	[AddressBookAmount] [decimal](20, 7) NOT NULL,
	[AddressBookAmount01] [decimal](20, 7) NOT NULL,
	[AmountOpenOrder] [decimal](20, 7) NOT NULL,
	[MinimumOrderValue] [decimal](15, 0) NOT NULL,
	[MaximumOrderValue] [decimal](15, 0) NOT NULL,
	[YTDOrders] [int] NOT NULL,
	[PriorYearOrders] [int] NOT NULL,
	[PersonOpeningAccount] [char](10) NOT NULL,
	[DateAccountOpened] [datetime] NOT NULL,
	[RelatedAddressNumber] [int] NOT NULL,
	[BillingAddressType] [char](1) NOT NULL,
	[CustomerPricingRule] [char](8) NOT NULL,
	[OrderTemplate] [char](8) NOT NULL,
	[TradeDiscount] [decimal](20, 7) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[ExemptFromCreditHold] [char](1) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[RouteCode] [char](3) NOT NULL,
	[StopCode] [char](3) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[DeliveryInstructions01] [char](30) NOT NULL,
	[DeliveryInstructions02] [char](30) NOT NULL,
	[LeadTimeTransitDays] [int] NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[ApplyFreightYN] [char](1) NOT NULL,
	[PartialShipmentsAllowed] [char](1) NOT NULL,
	[SubstitutesAllowed] [char](1) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[CustomerPORequired] [char](1) NOT NULL,
	[PriorityProcessingCode] [char](1) NOT NULL,
	[ARCreditCheckLevel] [char](1) NOT NULL,
	[InvoiceCopies] [int] NOT NULL,
	[InvoiceConsolidation] [char](1) NOT NULL,
	[BillingFrequency] [char](1) NOT NULL,
	[NextInvoiceDate] [datetime] NOT NULL,
	[LicenseExpirationDate] [datetime] NOT NULL,
	[PricePickList] [char](1) NOT NULL,
	[MergeOrders] [char](1) NOT NULL,
	[PalletControl] [char](1) NOT NULL,
	[CommissionCode01] [int] NOT NULL,
	[CommissionRate1] [decimal](20, 7) NOT NULL,
	[CommissionCode02] [int] NOT NULL,
	[CommissionRate2] [decimal](20, 7) NOT NULL,
	[WeightDisplayedUOM] [char](2) NOT NULL,
	[VolumeDisplayedUOM] [char](2) NOT NULL,
	[BatchProcessingMode] [char](1) NOT NULL,
	[CustomerTypeIdentifier] [char](1) NOT NULL,
	[ItemTypeIdentifier] [char](1) NOT NULL,
	[QuantityDecimals] [int] NOT NULL,
	[AmountDecimals] [int] NOT NULL,
	[FutureUse01] [char](1) NOT NULL,
	[FutureUse02] [char](1) NOT NULL,
	[PartialOrderShipmentsAllowed] [char](1) NOT NULL,
	[SpecialInstructions02] [char](1) NOT NULL,
	[SpecialInstructions03] [char](1) NOT NULL,
	[SpecialInstructions04] [char](1) NOT NULL,
	[SpecialInstructions05] [char](1) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[ReportCodes] [char](1) NOT NULL,
	[AdjustmentsOnInvoice] [char](1) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEARCustomerMaster] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEARCustomerMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDECSInstalledBaseLocationData]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDECSInstalledBaseLocationData]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDECSInstalledBaseLocationData](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[UniqueKeyIDInternal] [decimal](20, 7) NOT NULL,
	[Longitude] [char](25) NOT NULL,
	[Latitude] [char](25) NOT NULL,
	[EquipmentLocationElevation] [char](25) NOT NULL,
	[EquipmentLocationBuilding] [char](25) NOT NULL,
	[EquipmentLocationFloor] [char](25) NOT NULL,
	[EquipmentLocationRoom] [char](25) NOT NULL,
	[EquipmentLocationOther1] [char](25) NOT NULL,
	[EquipmentLocationOther2] [char](25) NOT NULL,
	[ContactName] [char](120) NOT NULL,
	[CaseFromPhoneCon1] [char](20) NOT NULL,
	[MailingName] [char](40) NOT NULL,
	[AddressLine1] [char](40) NOT NULL,
	[AddressLine2] [char](40) NOT NULL,
	[AddressLine3] [char](40) NOT NULL,
	[AddressLine4] [char](40) NOT NULL,
	[City] [char](25) NOT NULL,
	[County] [char](25) NOT NULL,
	[StateCode] [char](3) NOT NULL,
	[PostalCode] [char](12) NOT NULL,
	[CountryCode] [char](3) NOT NULL,
	[CreatedByUser] [char](10) NOT NULL,
	[CreationDate2] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDECSInstalledBaseLocationDeta] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDECSInstalledBaseLocationData] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDECSInstalledBaseLocationHist]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDECSInstalledBaseLocationHist]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDECSInstalledBaseLocationHist](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[UniqueKeyIDInternal] [decimal](20, 7) NOT NULL,
	[TypeOfRec] [char](1) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[AddressNumberLessor] [int] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[CostCenterLocation] [char](12) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[LocationHistOrSched] [char](1) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[TimeStampBeginning] [int] NOT NULL,
	[DateEnding] [datetime] NOT NULL,
	[TimeStampEnding] [int] NOT NULL,
	[TransferNumber] [char](12) NOT NULL,
	[TransferActionCode] [char](1) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DtLastChanged] [datetime] NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDECSInstalledBaseLocationHist] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDECSInstalledBaseLocationHist] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEEMEquipmentLocationBilling]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEEMEquipmentLocationBilling]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEEMEquipmentLocationBilling](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[TransferNumber] [char](12) NOT NULL,
	[NextNumberValue] [decimal](20, 7) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[CostCenterLocation] [char](12) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[RecordTypeRAL] [char](1) NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[BillingRateEquipment] [decimal](20, 7) NOT NULL,
	[ProRateBilling] [char](1) NOT NULL,
	[Quantity] [decimal](20, 7) NOT NULL,
	[HoursBilled] [decimal](20, 7) NOT NULL,
	[DaysBilled] [decimal](20, 7) NOT NULL,
	[WeeksBilled] [decimal](20, 7) NOT NULL,
	[MonthsBilled] [decimal](20, 7) NOT NULL,
	[DelimitedBillingTotal] [decimal](20, 7) NOT NULL,
	[DelimitedDateTs] [datetime] NOT NULL,
	[DateCurrentBilling] [datetime] NOT NULL,
	[AmountCurrentBilling] [decimal](20, 7) NOT NULL,
	[AmountTotalBilled] [decimal](20, 7) NOT NULL,
	[DtLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEEMEquipmentLocationBilling] PRIMARY KEY CLUSTERED 
(
	[TransferNumber] ASC,
	[NextNumberValue] ASC,
	[DateCurrentBilling] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEEMEquipmentLocationBilling] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEEMEquipmentRates]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEEMEquipmentRates]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEEMEquipmentRates](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[EquipmentRateTable] [char](3) NOT NULL,
	[EquipmentRateGroup] [char](3) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[AmountReplacementCost] [decimal](20, 7) NOT NULL,
	[BillingRateEquipment] [decimal](20, 7) NOT NULL,
	[RateComponent01] [decimal](20, 7) NOT NULL,
	[RateComponent02] [decimal](20, 7) NOT NULL,
	[RateComponent03] [decimal](20, 7) NOT NULL,
	[RateComponent04] [decimal](20, 7) NOT NULL,
	[RateComponent05] [decimal](20, 7) NOT NULL,
	[RateComponent06] [decimal](20, 7) NOT NULL,
	[RateComponent07] [decimal](20, 7) NOT NULL,
	[RateComponent08] [decimal](20, 7) NOT NULL,
	[RateComponent09] [decimal](20, 7) NOT NULL,
	[RateComponent10] [decimal](20, 7) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEEMEquipmentRates] PRIMARY KEY CLUSTERED 
(
	[EquipmentRateTable] ASC,
	[EquipmentRateGroup] ASC,
	[AssetItemNumber] ASC,
	[StartEffectiveDate] ASC,
	[EquipmentRateCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEEMEquipmentRates] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEEMMaintenanceRules]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEEMMaintenanceRules]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEEMMaintenanceRules](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[ServiceType] [char](8) NOT NULL,
	[ThresholdPercent] [int] NOT NULL,
	[MaintenanceStatus] [char](2) NOT NULL,
	[GroupingFromMaintenance] [char](2) NOT NULL,
	[GroupingToMaintenance] [char](2) NOT NULL,
	[StatusCodeWo] [char](2) NOT NULL,
	[PriorityWo] [char](1) NOT NULL,
	[TypeWo] [char](1) NOT NULL,
	[ChargeToWorkOrder] [char](1) NOT NULL,
	[WODescriptionFlag] [char](1) NOT NULL,
	[ApprovalType] [char](3) NOT NULL,
	[UnitNumber] [char](12) NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[RecordUpdateByUserNa] [char](10) NOT NULL,
	[ProgId] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[SamplingAmount] [int] NOT NULL,
	[ProjectedStartDateMethod] [char](1) NOT NULL,
	[DateProjectedFrom] [char](1) NOT NULL,
	[CopyLaborDetail] [char](1) NOT NULL,
	[CopyPartsList] [char](1) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[WorkOrderBranchPlant] [char](1) NOT NULL,
	[DefaultCustomer] [char](1) NOT NULL,
	[DefaultSite] [char](1) NOT NULL,
	[MaintenanceScheduleFlag] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEEMMaintenanceRules] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[ServiceType] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEEMMaintenanceRules] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEEMMeterReadingEstimates]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEEMMeterReadingEstimates]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEEMMeterReadingEstimates](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[UnitNumber] [char](12) NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[EstimatedFuelReading] [decimal](20, 7) NOT NULL,
	[EstMaintMeterReading] [decimal](20, 7) NOT NULL,
	[EstOperMeterReading] [decimal](20, 7) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[EstimateMeter4] [decimal](20, 7) NOT NULL,
	[EstimateMeter5] [decimal](20, 7) NOT NULL,
	[EstimateMeter6] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEEMMeterReadingEstimates] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[SubLedger] ASC,
	[SubledgerType] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEEMMeterReadingEstimates] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEEMPMProjections]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEEMPMProjections]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEEMPMProjections](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[ServiceType] [char](8) NOT NULL,
	[ForecastType] [char](2) NOT NULL,
	[ForecastQuantity] [decimal](22, 7) NOT NULL,
	[DateScheduledTickler] [datetime] NOT NULL,
	[HoursOriginal] [decimal](20, 7) NOT NULL,
	[AmountEstimatedLabor] [decimal](20, 7) NOT NULL,
	[AmountEstimatedMaterial] [decimal](20, 7) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[EstimatedDowntimeHours] [decimal](20, 7) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[Branch] [char](12) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[TypeWo] [char](1) NOT NULL,
	[PriorityWo] [char](1) NOT NULL,
	[StatusCodeWo] [char](2) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[AddressNumberManager] [int] NOT NULL,
	[Supervisor] [int] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ServiceAddressNumber] [int] NOT NULL,
	[DispatchGroup] [char](12) NOT NULL,
	[WorkCenterLeadCraft] [char](12) NOT NULL,
	[MaintenanceScheduleFlag] [char](1) NOT NULL,
	[WorkOrderNoAssigned] [int] NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[TypeBill] [char](3) NOT NULL,
	[TypeRouting] [char](3) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[MachineKey] [char](15) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEEMPMProjections] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[ServiceType] ASC,
	[ForecastType] ASC,
	[DateScheduledTickler] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEEMPMProjections] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEEMRentalRules]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEEMRentalRules]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEEMRentalRules](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[DefaultTable01] [char](3) NOT NULL,
	[DefaultTable02] [char](3) NOT NULL,
	[DefaultTable03] [char](3) NOT NULL,
	[DefaultTable04] [char](3) NOT NULL,
	[DefaultTable05] [char](3) NOT NULL,
	[PercentOverride01] [decimal](20, 7) NOT NULL,
	[PercentOverride02] [decimal](20, 7) NOT NULL,
	[PercentOverride03] [decimal](20, 7) NOT NULL,
	[PercentOverride04] [decimal](20, 7) NOT NULL,
	[PercentOverride05] [decimal](20, 7) NOT NULL,
	[BillingDate] [datetime] NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[BillingLimit] [decimal](20, 7) NOT NULL,
	[SubsequentRateTable] [char](3) NOT NULL,
	[SubsequentPctOverride] [decimal](20, 7) NOT NULL,
	[BuyBackPercent] [decimal](20, 7) NOT NULL,
	[ProRateBilling] [char](1) NOT NULL,
	[BillWeekends] [char](1) NOT NULL,
	[RentalThreshold] [decimal](20, 7) NOT NULL,
	[AdditionalRateTable] [char](3) NOT NULL,
	[TimeBeginningDefault] [int] NOT NULL,
	[TimeEndingDefault] [int] NOT NULL,
	[DtLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEEMRentalRules] PRIMARY KEY CLUSTERED 
(
	[CompanyNumber] ASC,
	[BusinessUnitCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEEMRentalRules] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAAnnualDepreciationRules]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAAnnualDepreciationRules]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAAnnualDepreciationRules](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[DepreciationMethod] [char](2) NOT NULL,
	[LifeMonths] [int] NOT NULL,
	[DepreciationInformation] [char](1) NOT NULL,
	[ComputationMethodITDorRem] [char](1) NOT NULL,
	[DateFrom] [datetime] NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[AssetLifeYearStart] [int] NOT NULL,
	[PlacedInServicePeriod] [int] NOT NULL,
	[SecondaryContinuation] [char](1) NOT NULL,
	[AssetLifeYearThrough] [int] NOT NULL,
	[AnnualMultiplier] [decimal](20, 7) NOT NULL,
	[DepreciationFormula] [char](3) NOT NULL,
	[BasisFormula] [char](3) NOT NULL,
	[SalvageFormula] [char](3) NOT NULL,
	[UpperLimitFormula] [char](3) NOT NULL,
	[LowerLimitFormula] [char](3) NOT NULL,
	[SpreadPatternReference] [char](3) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAAnnualDepreciationRules] PRIMARY KEY CLUSTERED 
(
	[DepreciationMethod] ASC,
	[LifeMonths] ASC,
	[ComputationMethodITDorRem] ASC,
	[DepreciationInformation] ASC,
	[DateFrom] ASC,
	[StartEffectiveDate] ASC,
	[AssetLifeYearStart] ASC,
	[PlacedInServicePeriod] ASC,
	[SecondaryContinuation] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAAnnualDepreciationRules] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAAssetAccountBalancesFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAAssetAccountBalancesFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAAssetAccountBalancesFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[Century] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[FiscalQuarter] [char](4) NOT NULL,
	[LedgerTypeCode] [char](2) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[PriorYearCloseBalance] [decimal](20, 7) NOT NULL,
	[NetPosting01] [decimal](20, 7) NOT NULL,
	[NetPosting02] [decimal](20, 7) NOT NULL,
	[NetPosting03] [decimal](20, 7) NOT NULL,
	[NetPosting04] [decimal](20, 7) NOT NULL,
	[NetPosting05] [decimal](20, 7) NOT NULL,
	[NetPosting06] [decimal](20, 7) NOT NULL,
	[NetPosting07] [decimal](20, 7) NOT NULL,
	[NetPosting08] [decimal](20, 7) NOT NULL,
	[NetPosting09] [decimal](20, 7) NOT NULL,
	[NetPosting10] [decimal](20, 7) NOT NULL,
	[NetPosting11] [decimal](20, 7) NOT NULL,
	[NetPosting12] [decimal](20, 7) NOT NULL,
	[NetPosting13] [decimal](20, 7) NOT NULL,
	[NetPosting14] [decimal](20, 7) NOT NULL,
	[PriorYearEndNetPosting] [decimal](20, 7) NOT NULL,
	[WeekToDateNetPosting] [decimal](20, 7) NOT NULL,
	[OriginalBeginningBudget] [decimal](20, 7) NOT NULL,
	[MemoBudgetChange] [decimal](20, 7) NOT NULL,
	[PercentComplete] [decimal](20, 7) NOT NULL,
	[MemoCommitmentChanges] [decimal](20, 7) NOT NULL,
	[RequestedBudget] [decimal](20, 7) NOT NULL,
	[ApprovedBudget] [decimal](20, 7) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[LifeMonths] [int] NOT NULL,
	[DepreciationMethod] [char](2) NOT NULL,
	[DepreciationInformation] [char](1) NOT NULL,
	[MethodPercent] [int] NOT NULL,
	[ScheduleNoMethod9] [char](12) NOT NULL,
	[ComputationMethodITDorRem] [char](1) NOT NULL,
	[DateDepreciationStarted] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[AssetAccountType] [char](1) NOT NULL,
	[DepreciationCalculationFlag] [char](1) NOT NULL,
	[CostBalanceCrossReference] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAAssetAccountBalancesFile] PRIMARY KEY CLUSTERED 
(
	[AccountID] ASC,
	[Century] ASC,
	[FiscalYear] ASC,
	[FiscalQuarter] ASC,
	[AssetItemNumber] ASC,
	[SubLedger] ASC,
	[SubledgerType] ASC,
	[LedgerTypeCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAAssetAccountBalancesFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAAssetMasterFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAAssetMasterFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAAssetMasterFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[UnitorTagNumber] [char](12) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[SequenceNumber] [int] NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[Description03] [char](30) NOT NULL,
	[DescriptionCompressed] [char](40) NOT NULL,
	[DateAcquired] [datetime] NOT NULL,
	[DateDisposedorRetired] [datetime] NOT NULL,
	[EquipmentStatus] [char](2) NOT NULL,
	[NeworUsedonAcquisition] [char](1) NOT NULL,
	[AmountEstimatedSalvageValue] [decimal](20, 7) NOT NULL,
	[AmountReplacementCost] [decimal](20, 7) NOT NULL,
	[AmountLastYearsReplacementCost] [decimal](20, 7) NOT NULL,
	[AssetCostAccountBusinessUnit] [char](12) NOT NULL,
	[AssetCostAccountObject] [char](6) NOT NULL,
	[AssetCostAccountSubsidiary] [char](8) NOT NULL,
	[AccumulatedDeprecAccountBU] [char](12) NOT NULL,
	[AccumulatedDeprecAccountObjct] [char](6) NOT NULL,
	[AccumulatedDeprecAccountSub] [char](8) NOT NULL,
	[DepreciationExpenseBU] [char](12) NOT NULL,
	[DepreciationExpenseObject] [char](6) NOT NULL,
	[DepreciationExpenseSubsidiary] [char](8) NOT NULL,
	[AssetRevenueBusinessUnit] [char](12) NOT NULL,
	[AssetRevenueObject] [char](6) NOT NULL,
	[AssetRevenueSubsidiary] [char](8) NOT NULL,
	[AssetItemCurrentQuantity] [decimal](20, 7) NOT NULL,
	[AssetItemOriginalQuantity] [decimal](20, 7) NOT NULL,
	[TaxEntity] [int] NOT NULL,
	[AmountInvestmentTaxCredit] [decimal](20, 7) NOT NULL,
	[AmountInvestmentTaxCreditPYE] [decimal](20, 7) NOT NULL,
	[FinancingMethod] [char](1) NOT NULL,
	[ITCOwnedYN] [char](1) NOT NULL,
	[PurchaseOption] [char](1) NOT NULL,
	[AmountPurchaseOptionPrice] [decimal](20, 7) NOT NULL,
	[PurchaseOptionCreditPercentage] [decimal](20, 7) NOT NULL,
	[AmountPurchaseOptionMaxCredit] [decimal](20, 7) NOT NULL,
	[AddressNumberLessorRentorMort] [int] NOT NULL,
	[DateContractDate] [datetime] NOT NULL,
	[DateExpiredJulian] [datetime] NOT NULL,
	[AmountMonthlyPayment] [decimal](20, 7) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[NameRemark] [char](30) NOT NULL,
	[InsurancePolicyNumber] [char](25) NOT NULL,
	[InsuranceCompany] [char](25) NOT NULL,
	[PolicyRenewalMonth] [int] NOT NULL,
	[AmountInsurancePremium] [decimal](20, 7) NOT NULL,
	[AmountInsuranceValue] [decimal](20, 7) NOT NULL,
	[InsuranceValueIndexfutureuse] [decimal](20, 7) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[BusinessUnitLocation] [char](12) NOT NULL,
	[StateCode] [char](3) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateExpectedReturn] [datetime] NOT NULL,
	[MessageClearedYN] [char](1) NOT NULL,
	[NameExplanation] [char](30) NOT NULL,
	[RemarkExplaination] [char](30) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[StandardFuelConsumption] [decimal](20, 7) NOT NULL,
	[DisposalAccumulatedDeprecBU] [char](12) NOT NULL,
	[DisposalAccumulatedDeprecObj] [char](6) NOT NULL,
	[DisposalAccumulatedDeprecSub] [char](8) NOT NULL,
	[UnitNumber] [char](8) NOT NULL,
	[ParentItemNumber] [int] NOT NULL,
	[ItemNumber2ndKit] [char](25) NOT NULL,
	[AFENumber] [char](12) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[UnionCode] [char](6) NOT NULL,
	[SubledgerInactiveCode] [char](1) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[Category11Code] [char](3) NOT NULL,
	[Category11] [char](30) NOT NULL,
	[Category12Code] [char](3) NOT NULL,
	[Category12] [char](30) NOT NULL,
	[Category13Code] [char](3) NOT NULL,
	[Category13] [char](30) NOT NULL,
	[Category14Code] [char](3) NOT NULL,
	[Category14] [char](30) NOT NULL,
	[Category15Code] [char](3) NOT NULL,
	[Category15] [char](30) NOT NULL,
	[Category16Code] [char](3) NOT NULL,
	[Category16] [char](30) NOT NULL,
	[Category17Code] [char](3) NOT NULL,
	[Category17] [char](30) NOT NULL,
	[Category18Code] [char](3) NOT NULL,
	[Category18] [char](30) NOT NULL,
	[Category19Code] [char](3) NOT NULL,
	[Category19] [char](30) NOT NULL,
	[Category20Code] [char](3) NOT NULL,
	[Category20] [char](30) NOT NULL,
	[Category21Code] [char](10) NOT NULL,
	[Category21] [char](30) NOT NULL,
	[Category22Code] [char](10) NOT NULL,
	[Category22] [char](30) NOT NULL,
	[Category23Code] [char](10) NOT NULL,
	[Category23] [char](30) NOT NULL,
	[AllowWorkOrderYN] [char](1) NOT NULL,
	[Criticality] [int] NOT NULL,
	[WarrantyFlag] [char](1) NOT NULL,
	[DateWarrantyExpirationJulian] [datetime] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAAssetMasterFile] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAAssetMasterFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFADepreciationFormulas]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFADepreciationFormulas]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFADepreciationFormulas](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[FormulaID] [char](3) NOT NULL,
	[Description] [char](20) NOT NULL,
	[DescriptionCompressed20Long] [char](20) NOT NULL,
	[ColumnHeading1] [char](11) NOT NULL,
	[ColumnHeading02] [char](11) NOT NULL,
	[FormulaInquiryColumn] [char](40) NOT NULL,
	[DecimalPositions] [int] NOT NULL,
	[EditCode] [char](1) NOT NULL,
	[DepreciationFormulaAmount] [decimal](20, 7) NOT NULL,
	[DataItemGlossary] [char](10) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[EditDisable] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFADepreciationFormulas] PRIMARY KEY CLUSTERED 
(
	[FormulaID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFADepreciationFormulas] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFADepreciationPeriodSpread]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFADepreciationPeriodSpread]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFADepreciationPeriodSpread](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[SpreadPatternReference] [char](3) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[PercentagePeriod01] [decimal](20, 7) NOT NULL,
	[PercentagePeriod02] [decimal](20, 7) NOT NULL,
	[PercentagePeriod03] [decimal](20, 7) NOT NULL,
	[PercentagePeriod04] [decimal](20, 7) NOT NULL,
	[PercentagePeriod05] [decimal](20, 7) NOT NULL,
	[PercentagePeriod06] [decimal](20, 7) NOT NULL,
	[PercentagePeriod07] [decimal](20, 7) NOT NULL,
	[PercentagePeriod08] [decimal](20, 7) NOT NULL,
	[PercentagePeriod09] [decimal](20, 7) NOT NULL,
	[PercentagePeriod10] [decimal](20, 7) NOT NULL,
	[PercentagePeriod11] [decimal](20, 7) NOT NULL,
	[PercentagePeriod12] [decimal](20, 7) NOT NULL,
	[PercentagePeriod13] [decimal](20, 7) NOT NULL,
	[PercentagePeriod14] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFADepreciationPeriodSpreadRules] PRIMARY KEY CLUSTERED 
(
	[SpreadPatternReference] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFADepreciationPeriodSpread] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFADepreciationRules]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFADepreciationRules]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFADepreciationRules](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[Description] [char](30) NOT NULL,
	[DepreciationMethod] [char](2) NOT NULL,
	[LifeMonths] [int] NOT NULL,
	[DepreciationInformation] [char](1) NOT NULL,
	[ComputationMethodITDorRem] [char](1) NOT NULL,
	[DateFrom] [datetime] NOT NULL,
	[DateThru] [datetime] NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[DepreciationBusinessUnit] [char](1) NOT NULL,
	[FiscalDatePattern] [char](1) NOT NULL,
	[FirstYearSpreadConvention] [char](1) NOT NULL,
	[LifeYearReferenceConvention] [char](1) NOT NULL,
	[LastYearSpreadConvention] [char](1) NOT NULL,
	[DisposalConvention] [char](1) NOT NULL,
	[OverUnderAllowed] [char](1) NOT NULL,
	[NegativeAllowed] [char](1) NOT NULL,
	[SecondaryAcctConvention] [char](1) NOT NULL,
	[DepreciationCalculationFlag] [char](1) NOT NULL,
	[EditDisable] [char](1) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFADepreciationRules] PRIMARY KEY CLUSTERED 
(
	[DepreciationMethod] ASC,
	[LifeMonths] ASC,
	[DepreciationInformation] ASC,
	[ComputationMethodITDorRem] ASC,
	[DateFrom] ASC,
	[StartEffectiveDate] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFADepreciationRules] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAEquipmentLicenseMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAEquipmentLicenseMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAEquipmentLicenseMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[LicenseNumber] [char](8) NOT NULL,
	[StateCode] [char](3) NOT NULL,
	[AddressNumberLicensingAgency] [int] NOT NULL,
	[DateLicenseLastIssued] [datetime] NOT NULL,
	[AmountLicenseFee] [decimal](20, 7) NOT NULL,
	[DateLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateLicenseRenewalJulian] [datetime] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAEquipmentLicenseMaster] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[StateCode] ASC,
	[LicenseNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAEquipmentLicenseMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAEquipmentMasterExtension]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAEquipmentMasterExtension]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAEquipmentMasterExtension](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[CountryCode] [char](3) NOT NULL,
	[CompanyOwned] [char](1) NOT NULL,
	[Branch] [char](12) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[DateOrderedJulian] [datetime] NOT NULL,
	[DateShippedJulian] [datetime] NOT NULL,
	[ActualDeliveryDate] [datetime] NOT NULL,
	[ShipTo] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[SalespersonCode01] [int] NOT NULL,
	[AddNumOwnerBilling] [int] NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[DateCompletion] [datetime] NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[OriginalOrderNumber] [char](8) NOT NULL,
	[OriginalOrderTypeCode] [char](2) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[OriginalLineNumber] [decimal](20, 7) NOT NULL,
	[ProductFamily] [char](8) NOT NULL,
	[ProductModel] [char](8) NOT NULL,
	[ProductComponent] [char](10) NOT NULL,
	[ConfiguredModel] [char](25) NOT NULL,
	[SystemCodeEncryptedMatri] [char](36) NOT NULL,
	[VehicleIdentNum] [char](30) NOT NULL,
	[ReferenceNumber] [char](30) NOT NULL,
	[Category01Code] [char](10) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](10) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](10) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](10) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](10) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](10) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](10) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](10) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](10) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](10) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[CreatedByUser] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[Location] [char](20) NOT NULL,
	[WorkOrderNumber] [int] NOT NULL,
	[BillRevisionLevel] [char](3) NOT NULL,
	[EffectiveFromDate] [datetime] NOT NULL,
	[DefaultDealer] [int] NOT NULL,
	[AssessorNumber] [int] NOT NULL,
	[TermsAcceptedFlag] [char](1) NOT NULL,
	[SalesType] [char](3) NOT NULL,
	[InServiceDate] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[MeterReadingRequired] [char](1) NOT NULL,
	[RegistrationStatus] [char](3) NOT NULL,
	[CompCodeGrpSys] [char](2) NOT NULL,
	[CompCodeAssembly] [char](8) NOT NULL,
	[Manufacturer] [char](10) NOT NULL,
	[Distributor] [int] NOT NULL,
	[EquipmentPartsNumber] [int] NOT NULL,
	[AllowMeterSchedules] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAEquipmentMasterExtension] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAEquipmentMasterExtension] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAEquipmentMessages]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAEquipmentMessages]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAEquipmentMessages](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[ExplanationFull] [varchar](1200) NOT NULL,
	[DateMessages] [datetime] NOT NULL,
	[DateCentury] [int] NOT NULL,
	[TimeOfDay] [decimal](20, 7) NOT NULL,
	[DateScheduledTickler] [datetime] NOT NULL,
	[AmtMilesOrHoursUnit] [decimal](20, 7) NOT NULL,
	[EquipmentMessageType] [char](1) NOT NULL,
	[ItemMessageStatus] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DtLastChanged] [datetime] NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[ServiceDateTax] [datetime] NOT NULL,
	[AmtSchedulePrimaryUm] [decimal](20, 7) NOT NULL,
	[AmtScheduleSecondUm] [decimal](20, 7) NOT NULL,
	[AmountScheduleDays] [decimal](20, 7) NOT NULL,
	[AmtActLastServMiHr] [decimal](20, 7) NOT NULL,
	[AmtActLastServPriUm] [decimal](20, 7) NOT NULL,
	[AmtActLastServSecUm] [decimal](20, 7) NOT NULL,
	[AmtActLastServDays] [decimal](20, 7) NOT NULL,
	[CalcuMethodMilesHrs] [char](1) NOT NULL,
	[CalculaMethodPriUm] [char](1) NOT NULL,
	[CalculaMethodSecondUm] [char](1) NOT NULL,
	[CalculationMethodDays] [char](1) NOT NULL,
	[DateJulian] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAEquipmentMessages] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[TimeOfDay] ASC,
	[DateJulian] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAEquipmentMessages] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAEquipmentPMScheduleModel]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAEquipmentPMScheduleModel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAEquipmentPMScheduleModel](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ServiceType] [char](8) NOT NULL,
	[DateScheduledTickler] [datetime] NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[WorkOrderNoAssigned] [int] NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[CompletedHours] [decimal](20, 7) NOT NULL,
	[ConsumedFuel] [decimal](20, 7) NOT NULL,
	[CompletedMilesHours] [decimal](20, 7) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[UserDefinedCodesValues] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastCompletedDate] [datetime] NOT NULL,
	[LastHours] [decimal](20, 7) NOT NULL,
	[LastFuelConsumed] [decimal](20, 7) NOT NULL,
	[LastMilesHours] [decimal](20, 7) NOT NULL,
	[MaintPercentComplete] [int] NOT NULL,
	[MaintenancePriority] [char](1) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[MaintenanceStatus] [char](2) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[ServiceDays] [int] NOT NULL,
	[ServiceHours] [decimal](20, 7) NOT NULL,
	[ServiceFuel] [decimal](20, 7) NOT NULL,
	[ServiceMilesHours] [decimal](20, 7) NOT NULL,
	[WeekNumber] [int] NOT NULL,
	[UniqueKeyIDInternal] [decimal](20, 7) NOT NULL,
	[ToleranceLimitUpper] [decimal](20, 7) NOT NULL,
	[ToleranceLimitLower] [decimal](20, 7) NOT NULL,
	[WeeksSpecific] [decimal](20, 7) NOT NULL,
	[MonthsSpecific] [decimal](20, 7) NOT NULL,
	[HoursSpecific] [decimal](20, 7) NOT NULL,
	[SpecificDayOfTheWeek] [char](1) NOT NULL,
	[DatePlannedToStart] [datetime] NOT NULL,
	[PMCategory02Code] [char](3) NOT NULL,
	[PMCategory02] [char](30) NOT NULL,
	[PMCategory01Code] [char](3) NOT NULL,
	[PMCategory01] [char](30) NOT NULL,
	[AlertLevel] [char](1) NOT NULL,
	[OriginalMiles] [decimal](20, 7) NOT NULL,
	[OriginalHours] [decimal](20, 7) NOT NULL,
	[OriginalFuel] [decimal](20, 7) NOT NULL,
	[Occurences] [decimal](20, 7) NOT NULL,
	[MultipleWO] [char](1) NOT NULL,
	[DateHold] [datetime] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[DowntimeRequired] [decimal](20, 7) NOT NULL,
	[Criticality] [int] NOT NULL,
	[FrequencyIndicator] [char](1) NOT NULL,
	[CompletedDate] [datetime] NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[UnitNumber] [char](12) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[AddNoAssignedTo] [int] NOT NULL,
	[ScheduleType] [char](1) NOT NULL,
	[ServiceMeter4] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter4] [decimal](20, 7) NOT NULL,
	[CompletedMeter4] [decimal](20, 7) NOT NULL,
	[OriginalMeter4] [decimal](20, 7) NOT NULL,
	[ServiceMeter5] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter5] [decimal](20, 7) NOT NULL,
	[CompletedMeter5] [decimal](20, 7) NOT NULL,
	[OriginalMeter5] [decimal](20, 7) NOT NULL,
	[ServiceMeter6] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter6] [decimal](20, 7) NOT NULL,
	[CompletedMeter6] [decimal](20, 7) NOT NULL,
	[OriginalMeter6] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAEquipmentPMScheduleModel] PRIMARY KEY CLUSTERED 
(
	[ServiceType] ASC,
	[Category10Code] ASC,
	[Category01Code] ASC,
	[Category02Code] ASC,
	[Category03Code] ASC,
	[Category04Code] ASC,
	[Category05Code] ASC,
	[Category06Code] ASC,
	[Category07Code] ASC,
	[Category08Code] ASC,
	[Category09Code] ASC,
	[AssetItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAEquipmentPMScheduleModel] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFALocationTrackingTable]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFALocationTrackingTable]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFALocationTrackingTable](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[LocationHistOrSched] [char](1) NOT NULL,
	[CostCenterLocation] [char](12) NOT NULL,
	[DateEnding] [datetime] NOT NULL,
	[Remark] [char](30) NOT NULL,
	[DtLastChanged] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[TransferNumber] [char](12) NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[Quantity] [decimal](20, 7) NOT NULL,
	[EquipmentStatus] [char](2) NOT NULL,
	[NextNumberValue] [decimal](20, 7) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[TimeStampBeginning] [int] NOT NULL,
	[TimeStampEnding] [int] NOT NULL,
	[MeterOriginalReading] [decimal](20, 7) NOT NULL,
	[MeterCurrentReading] [decimal](20, 7) NOT NULL,
	[EquipmentRateTable] [char](3) NOT NULL,
	[EquipmentRateGroup] [char](3) NOT NULL,
	[AmountActualBilled] [decimal](20, 7) NOT NULL,
	[Aisle] [char](8) NOT NULL,
	[Bin] [char](8) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[TransferActionCode] [char](1) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFALocationTrackingTable] PRIMARY KEY CLUSTERED 
(
	[NextNumberValue] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFALocationTrackingTable] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAMaintenanceScheduleFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAMaintenanceScheduleFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAMaintenanceScheduleFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[UnitNumber] [char](12) NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[ServiceType] [char](8) NOT NULL,
	[MaintenanceStatus] [char](2) NOT NULL,
	[MaintenancePriority] [char](1) NOT NULL,
	[UserDefinedCodesValues] [char](10) NOT NULL,
	[AddNoAssignedTo] [int] NOT NULL,
	[Remark] [char](30) NOT NULL,
	[ServiceDays] [int] NOT NULL,
	[ServiceMilesHours] [decimal](20, 7) NOT NULL,
	[ServiceFuel] [decimal](20, 7) NOT NULL,
	[DateScheduledTickler] [datetime] NOT NULL,
	[CompletedMilesHours] [decimal](20, 7) NOT NULL,
	[ConsumedFuel] [decimal](20, 7) NOT NULL,
	[CompletedDate] [datetime] NOT NULL,
	[LastMilesHours] [decimal](20, 7) NOT NULL,
	[LastFuelConsumed] [decimal](20, 7) NOT NULL,
	[LastCompletedDate] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[WorkOrderNoAssigned] [int] NOT NULL,
	[MaintPercentComplete] [int] NOT NULL,
	[ServiceHours] [decimal](20, 7) NOT NULL,
	[CompletedHours] [decimal](20, 7) NOT NULL,
	[LastHours] [decimal](20, 7) NOT NULL,
	[MultipleWO] [char](1) NOT NULL,
	[OriginalMiles] [decimal](20, 7) NOT NULL,
	[OriginalHours] [decimal](20, 7) NOT NULL,
	[OriginalFuel] [decimal](20, 7) NOT NULL,
	[Occurences] [decimal](20, 7) NOT NULL,
	[FrequencyIndicator] [char](1) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[Criticality] [int] NOT NULL,
	[DatePlannedToStart] [datetime] NOT NULL,
	[PMCategory01Code] [char](3) NOT NULL,
	[PMCategory01] [char](30) NOT NULL,
	[PMCategory02Code] [char](3) NOT NULL,
	[PMCategory02] [char](30) NOT NULL,
	[DowntimeRequired] [decimal](20, 7) NOT NULL,
	[AlertLevel] [char](1) NOT NULL,
	[UniqueKeyIDInternal] [decimal](20, 7) NOT NULL,
	[ToleranceLimitUpper] [decimal](20, 7) NOT NULL,
	[ToleranceLimitLower] [decimal](20, 7) NOT NULL,
	[DateHold] [datetime] NOT NULL,
	[HoursSpecific] [decimal](20, 7) NOT NULL,
	[WeeksSpecific] [decimal](20, 7) NOT NULL,
	[MonthsSpecific] [decimal](20, 7) NOT NULL,
	[WeekNumber] [int] NOT NULL,
	[SpecificDayOfTheWeek] [char](1) NOT NULL,
	[ScheduleType] [char](1) NOT NULL,
	[ServiceMeter4] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter4] [decimal](20, 7) NOT NULL,
	[CompletedMeter4] [decimal](20, 7) NOT NULL,
	[OriginalMeter4] [decimal](20, 7) NOT NULL,
	[ServiceMeter5] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter5] [decimal](20, 7) NOT NULL,
	[CompletedMeter5] [decimal](20, 7) NOT NULL,
	[OriginalMeter5] [decimal](20, 7) NOT NULL,
	[ServiceMeter6] [decimal](20, 7) NOT NULL,
	[LastCompletedMeter6] [decimal](20, 7) NOT NULL,
	[CompletedMeter6] [decimal](20, 7) NOT NULL,
	[OriginalMeter6] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAMaintenanceScheduleFile] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAMaintenanceScheduleFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFAParentHistory]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAParentHistory]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFAParentHistory](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFAParentHistory] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[ParentNumber] ASC,
	[StartEffectiveDate] ASC,
	[DateEndingEffective] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFAParentHistory] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEFASpecificationData]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEFASpecificationData]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEFASpecificationData](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[NumberPage] [int] NOT NULL,
	[DataItemField001] [char](25) NOT NULL,
	[DataItemField002] [char](25) NOT NULL,
	[DataItemField003] [char](25) NOT NULL,
	[DataItemField004] [char](25) NOT NULL,
	[DataItemField005] [char](25) NOT NULL,
	[DataItemField006] [char](25) NOT NULL,
	[DataItemField007] [char](25) NOT NULL,
	[DataItemField008] [char](25) NOT NULL,
	[DataItemField009] [char](25) NOT NULL,
	[DataItemField010] [char](25) NOT NULL,
	[DataItemField011] [char](25) NOT NULL,
	[DataItemField012] [char](25) NOT NULL,
	[DataItemField013] [char](25) NOT NULL,
	[DataItemField014] [char](25) NOT NULL,
	[DataItemField015] [char](25) NOT NULL,
	[DataItemField016] [char](25) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEFASpecificationData] PRIMARY KEY CLUSTERED 
(
	[AssetItemNumber] ASC,
	[NumberPage] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEFASpecificationData] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGAAccountBalances]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGAAccountBalances]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGAAccountBalances](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[Century] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[FiscalQuarter] [char](4) NOT NULL,
	[LedgerTypeCode] [char](2) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[PriorYearCloseBalance] [decimal](20, 7) NOT NULL,
	[NetPosting01] [decimal](20, 7) NOT NULL,
	[NetPosting02] [decimal](20, 7) NOT NULL,
	[NetPosting03] [decimal](20, 7) NOT NULL,
	[NetPosting04] [decimal](20, 7) NOT NULL,
	[NetPosting05] [decimal](20, 7) NOT NULL,
	[NetPosting06] [decimal](20, 7) NOT NULL,
	[NetPosting07] [decimal](20, 7) NOT NULL,
	[NetPosting08] [decimal](20, 7) NOT NULL,
	[NetPosting09] [decimal](20, 7) NOT NULL,
	[NetPosting10] [decimal](20, 7) NOT NULL,
	[NetPosting11] [decimal](20, 7) NOT NULL,
	[NetPosting12] [decimal](20, 7) NOT NULL,
	[NetPosting13] [decimal](20, 7) NOT NULL,
	[NetPosting14] [decimal](20, 7) NOT NULL,
	[PriorYearEndNetPosting] [decimal](20, 7) NOT NULL,
	[WeekToDateNetPosting] [decimal](20, 7) NOT NULL,
	[OriginalBeginningBudget] [decimal](20, 7) NOT NULL,
	[MemoBudgetChange] [decimal](20, 7) NOT NULL,
	[PercentComplete] [decimal](20, 7) NOT NULL,
	[MemoCommitmentChanges] [decimal](20, 7) NOT NULL,
	[RequestedBudget] [decimal](20, 7) NOT NULL,
	[ApprovedBudget] [decimal](20, 7) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Object] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[CurrencyCodeFrom] [char](3) NOT NULL,
	[CurrencyCodeIn] [char](3) NOT NULL,
	[BalanceForward] [decimal](20, 7) NOT NULL,
	[PurgeFlag] [char](1) NOT NULL,
	[NetDebitPosting01] [decimal](20, 7) NOT NULL,
	[NetDebitPosting02] [decimal](20, 7) NOT NULL,
	[NetDebitPosting03] [decimal](20, 7) NOT NULL,
	[NetDebitPosting04] [decimal](20, 7) NOT NULL,
	[NetDebitPosting05] [decimal](20, 7) NOT NULL,
	[NetDebitPosting06] [decimal](20, 7) NOT NULL,
	[NetDebitPosting07] [decimal](20, 7) NOT NULL,
	[NetDebitPosting08] [decimal](20, 7) NOT NULL,
	[NetDebitPosting09] [decimal](20, 7) NOT NULL,
	[NetDebitPosting10] [decimal](20, 7) NOT NULL,
	[NetDebitPosting11] [decimal](20, 7) NOT NULL,
	[NetDebitPosting12] [decimal](20, 7) NOT NULL,
	[NetDebitPosting13] [decimal](20, 7) NOT NULL,
	[NetDebitPosting14] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGAAccountBalances] PRIMARY KEY CLUSTERED 
(
	[AccountID] ASC,
	[Century] ASC,
	[FiscalYear] ASC,
	[FiscalQuarter] ASC,
	[LedgerTypeCode] ASC,
	[SubLedger] ASC,
	[SubledgerType] ASC,
	[CurrencyCodeFrom] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGAAccountBalances] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGAAccountLedger]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGAAccountLedger]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGAAccountLedger](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[JournalEntryLineNumber] [decimal](20, 7) NOT NULL,
	[LineExtensionCode] [char](2) NOT NULL,
	[GLPostedCode] [char](1) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchType] [char](2) NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[BatchSystemDate] [datetime] NOT NULL,
	[BatchTime] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[AccountNumber] [char](29) NOT NULL,
	[AccountMode01] [char](1) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Object] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[LedgerTypeCode] [char](2) NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[Century] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[FiscalQuarter] [char](4) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[HistoricalExchangeRate] [decimal](20, 7) NOT NULL,
	[HistoricalDate] [datetime] NOT NULL,
	[Amount] [decimal](20, 7) NOT NULL,
	[Units] [decimal](20, 7) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[ReverseOrVoidEntry] [char](1) NOT NULL,
	[ExplanationDescription] [char](30) NOT NULL,
	[RemarkExplanation] [char](30) NOT NULL,
	[Ref1JEVouchInvEtc] [char](8) NOT NULL,
	[Ref2AddressNumber] [char](8) NOT NULL,
	[Ref3AccountReconciliation] [char](8) NOT NULL,
	[PayItem] [char](3) NOT NULL,
	[OriginalDocumentNumber] [int] NOT NULL,
	[OriginalDocumentType] [char](2) NOT NULL,
	[OriginalPayItem] [char](3) NOT NULL,
	[PurchaseOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[PurchaseOrderDocumentType] [char](2) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PaymentNumber] [char](8) NOT NULL,
	[CheckDate] [datetime] NOT NULL,
	[CheckClearedDate] [datetime] NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[BatchRearEndPostedCode] [char](1) NOT NULL,
	[Reconciled] [char](1) NOT NULL,
	[SummarizedCode] [char](1) NOT NULL,
	[PurgeCode] [char](1) NOT NULL,
	[FlagFor1099] [char](1) NOT NULL,
	[AlternateGLPostingCode1] [char](1) NOT NULL,
	[AlternateGLPostingCode2] [char](1) NOT NULL,
	[AlternateGLPostingCode3] [char](1) NOT NULL,
	[AlternateGLPostingCode4] [char](1) NOT NULL,
	[MultiCurrencyJournalEntry] [char](1) NOT NULL,
	[CashBasisAccountingPostCode] [char](1) NOT NULL,
	[CommitmentReliefFlag] [char](1) NOT NULL,
	[BillingControl] [char](1) NOT NULL,
	[CurrencyUpdate] [char](1) NOT NULL,
	[LaborCostingFlag] [char](1) NOT NULL,
	[FutureUseFlag11] [char](1) NOT NULL,
	[FutureUseFlag12] [char](1) NOT NULL,
	[FutureUseFlag13] [char](1) NOT NULL,
	[FutureUseFlag14] [char](1) NOT NULL,
	[ConsumptionTaxCrossReference] [char](1) NOT NULL,
	[FutureUseFlag16] [char](1) NOT NULL,
	[DeleteNotAllowed] [char](1) NOT NULL,
	[FutureUseFlag18] [char](1) NOT NULL,
	[FutureUseFlag19] [char](1) NOT NULL,
	[LeaseCostLedgerPostedCode] [char](1) NOT NULL,
	[BillCode] [char](1) NOT NULL,
	[InvoiceNumber] [char](25) NOT NULL,
	[InvoiceDate] [datetime] NOT NULL,
	[Phase] [char](4) NOT NULL,
	[PONumber] [char](8) NOT NULL,
	[PurchaseOrderSuffix] [char](3) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[FiscalYearWeekly] [int] NOT NULL,
	[FiscalPeriodWeekly] [int] NOT NULL,
	[ClosedStatement] [char](1) NOT NULL,
	[OperationsSequenceNumber] [decimal](20, 7) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[HomeBusinessUnit] [char](12) NOT NULL,
	[DOISub] [int] NOT NULL,
	[OutsiderLeaseWellID] [char](25) NOT NULL,
	[IDType] [char](2) NOT NULL,
	[ServiceDateTax] [datetime] NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[RegistrationNumber] [int] NOT NULL,
	[InternalPaymentID] [decimal](15, 0) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[ManagerialAnalysisCode1] [char](12) NOT NULL,
	[ManagerialAnalysisCode2] [char](12) NOT NULL,
	[ManagerialAnalysisCode3] [char](12) NOT NULL,
	[ManagerialAnalysisCode4] [char](12) NOT NULL,
	[ManagerialAnalysisType1] [char](1) NOT NULL,
	[ManagerialAnalysisType2] [char](1) NOT NULL,
	[ManagerialAnalysisType3] [char](1) NOT NULL,
	[ManagerialAnalysisType4] [char](1) NOT NULL,
	[ItemNumberShort] [int] NOT NULL,
	[PostingCode1ManagerialAccount] [char](1) NOT NULL,
	[PostingCode2ManagerialAccount] [char](1) NOT NULL,
	[PostingCode3ManagerialAccount] [char](1) NOT NULL,
	[PostingCode4ManagerialAccount] [char](1) NOT NULL,
	[PostingCode5ManagerialAccount] [char](1) NOT NULL,
	[PostingCode6ManagerialAccount] [char](1) NOT NULL,
	[PostingCode7ManagerialAccount] [char](1) NOT NULL,
	[PostingCode8ManagerialAccount] [char](1) NOT NULL,
	[PostingCode9ManagerialAccount] [char](1) NOT NULL,
	[PostingCode10ManagerialAccount] [char](1) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[CurrencyModeForeignDomEntry] [char](1) NOT NULL,
	[PurgeFlag] [char](1) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplCode1] [char](2) NOT NULL,
	[TaxShortItemNumber] [int] NOT NULL,
	[ActivityBasedCostingActyCode] [char](10) NOT NULL,
	[FutureUseFlag] [char](1) NOT NULL,
	[CurrencyAmount] [decimal](20, 7) NOT NULL,
	[DistributionLineNumber] [decimal](20, 7) NOT NULL,
	[ReceiptNumber] [char](25) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGAAccountLedger] PRIMARY KEY CLUSTERED 
(
	[DocumentNumber] ASC,
	[DocumentType] ASC,
	[DocumentCompany] ASC,
	[GLDate] ASC,
	[JournalEntryLineNumber] ASC,
	[LedgerTypeCode] ASC,
	[LineExtensionCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGAAccountLedger] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGAAccountMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGAAccountMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGAAccountMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Object] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[FlexAccount] [char](25) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[AccountLevelOfDetail] [char](1) NOT NULL,
	[BudgetPatternCode] [char](3) NOT NULL,
	[PostingEditCode] [char](1) NOT NULL,
	[Billable] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[Category11Code] [char](3) NOT NULL,
	[Category11] [char](30) NOT NULL,
	[Category12Code] [char](3) NOT NULL,
	[Category12] [char](30) NOT NULL,
	[Category13Code] [char](3) NOT NULL,
	[Category13] [char](30) NOT NULL,
	[Category14Code] [char](3) NOT NULL,
	[Category14] [char](30) NOT NULL,
	[Category15Code] [char](3) NOT NULL,
	[Category15] [char](30) NOT NULL,
	[Category16Code] [char](3) NOT NULL,
	[Category16] [char](30) NOT NULL,
	[Category17Code] [char](3) NOT NULL,
	[Category17] [char](30) NOT NULL,
	[Category18Code] [char](3) NOT NULL,
	[Category18] [char](30) NOT NULL,
	[Category19Code] [char](3) NOT NULL,
	[Category19] [char](30) NOT NULL,
	[Category20Code] [char](3) NOT NULL,
	[Category20] [char](30) NOT NULL,
	[Category21Code] [char](10) NOT NULL,
	[Category21] [char](30) NOT NULL,
	[Category22Code] [char](10) NOT NULL,
	[Category22] [char](30) NOT NULL,
	[Category23Code] [char](10) NOT NULL,
	[Category23] [char](30) NOT NULL,
	[Category24Code] [char](10) NOT NULL,
	[Category24] [char](30) NOT NULL,
	[Category25Code] [char](10) NOT NULL,
	[Category25] [char](30) NOT NULL,
	[Category26Code] [char](10) NOT NULL,
	[Category26] [char](30) NOT NULL,
	[Category27Code] [char](10) NOT NULL,
	[Category27] [char](30) NOT NULL,
	[Category28Code] [char](10) NOT NULL,
	[Category28] [char](30) NOT NULL,
	[Category29Code] [char](10) NOT NULL,
	[Category29] [char](30) NOT NULL,
	[Category30Code] [char](10) NOT NULL,
	[Category30] [char](30) NOT NULL,
	[Category31Code] [char](10) NOT NULL,
	[Category31] [char](30) NOT NULL,
	[Category32Code] [char](10) NOT NULL,
	[Category32] [char](30) NOT NULL,
	[Category33Code] [char](10) NOT NULL,
	[Category33] [char](30) NOT NULL,
	[Category34Code] [char](10) NOT NULL,
	[Category34] [char](30) NOT NULL,
	[Category35Code] [char](10) NOT NULL,
	[Category35] [char](30) NOT NULL,
	[Category36Code] [char](10) NOT NULL,
	[Category36] [char](30) NOT NULL,
	[Category37Code] [char](10) NOT NULL,
	[Category37] [char](30) NOT NULL,
	[Category38Code] [char](10) NOT NULL,
	[Category38] [char](30) NOT NULL,
	[Category39Code] [char](10) NOT NULL,
	[Category39] [char](30) NOT NULL,
	[Category40Code] [char](10) NOT NULL,
	[Category40] [char](30) NOT NULL,
	[Category41Code] [char](10) NOT NULL,
	[Category41] [char](30) NOT NULL,
	[Category42Code] [char](10) NOT NULL,
	[Category42] [char](30) NOT NULL,
	[Category43Code] [char](10) NOT NULL,
	[Category43] [char](30) NOT NULL,
	[AlternateObject] [char](6) NOT NULL,
	[AlternateSubsidiary] [char](8) NOT NULL,
	[WorkersComp] [char](4) NOT NULL,
	[MethodOfComputation] [char](1) NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[HeaderTypeCode] [char](1) NOT NULL,
	[LevelOfDetailQuantityRollUp] [char](1) NOT NULL,
	[CostCodeComplete] [char](1) NOT NULL,
	[ModelAccountConsolidations] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[CostObjectEditCode01] [char](1) NOT NULL,
	[CostObjectEditCode02] [char](1) NOT NULL,
	[CostObjectEditCode03] [char](1) NOT NULL,
	[CostObjectEditCode04] [char](1) NOT NULL,
	[ItemEditCode] [char](1) NOT NULL,
	[FixedAssetPostingEditCode] [char](1) NOT NULL,
	[TypeCode] [char](1) NOT NULL,
	[GLAccountTaxableFlag] [char](1) NOT NULL,
	[TargetObjectAccount] [char](6) NOT NULL,
	[TargetSubsidiary] [char](8) NOT NULL,
	[PurgeFlag] [char](1) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
	[Category01Desc2] [char](30) NOT NULL,
	[Category02Desc2] [char](30) NOT NULL,
	[Category03Desc2] [char](30) NOT NULL,
	[Category04Desc2] [char](30) NOT NULL,
	[Category05Desc2] [char](30) NOT NULL,
	[Category06Desc2] [char](30) NOT NULL,
	[Category07Desc2] [char](30) NOT NULL,
	[Category08Desc2] [char](30) NOT NULL,
	[Category09Desc2] [char](30) NOT NULL,
	[Category10Desc2] [char](30) NOT NULL,
	[Category11Desc2] [char](30) NOT NULL,
	[Category12Desc2] [char](30) NOT NULL,
	[Category13Desc2] [char](30) NOT NULL,
	[Category14Desc2] [char](30) NOT NULL,
	[Category15Desc2] [char](30) NOT NULL,
	[Category16Desc2] [char](30) NOT NULL,
	[Category17Desc2] [char](30) NOT NULL,
	[Category18Desc2] [char](30) NOT NULL,
	[Category19Desc2] [char](30) NOT NULL,
	[Category20Desc2] [char](30) NOT NULL,
	[Category21Desc2] [char](30) NOT NULL,
	[Category22Desc2] [char](30) NOT NULL,
	[Category23Desc2] [char](30) NOT NULL,
	[Category24Desc2] [char](30) NOT NULL,
	[Category25Desc2] [char](30) NOT NULL,
	[Category26Desc2] [char](30) NOT NULL,
	[Category27Desc2] [char](30) NOT NULL,
	[Category28Desc2] [char](30) NOT NULL,
	[Category29Desc2] [char](30) NOT NULL,
	[Category30Desc2] [char](30) NOT NULL,
	[Category31Desc2] [char](30) NOT NULL,
	[Category32Desc2] [char](30) NOT NULL,
	[Category33Desc2] [char](30) NOT NULL,
	[Category34Desc2] [char](30) NOT NULL,
	[Category35Desc2] [char](30) NOT NULL,
	[Category36Desc2] [char](30) NOT NULL,
	[Category37Desc2] [char](30) NOT NULL,
	[Category38Desc2] [char](30) NOT NULL,
	[Category39Desc2] [char](30) NOT NULL,
	[Category40Desc2] [char](30) NOT NULL,
	[Category41Desc2] [char](30) NOT NULL,
	[Category42Desc2] [char](30) NOT NULL,
	[Category43Desc2] [char](30) NOT NULL,
 CONSTRAINT [PK_JDEGAAccountMaster] PRIMARY KEY CLUSTERED 
(
	[AccountID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGAAccountMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSAccountFiscalDatePatterns]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSAccountFiscalDatePatterns]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSAccountFiscalDatePatterns](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[FiscalDatePattern] [char](1) NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[DateFiscalYearBegins] [datetime] NOT NULL,
	[FiscalQuarter] [char](4) NOT NULL,
	[EndOfPeriod01] [datetime] NOT NULL,
	[EndOfPeriod02] [datetime] NOT NULL,
	[EndOfPeriod03] [datetime] NOT NULL,
	[EndOfPeriod04] [datetime] NOT NULL,
	[EndOfPeriod05] [datetime] NOT NULL,
	[EndOfPeriod06] [datetime] NOT NULL,
	[EndOfPeriod07] [datetime] NOT NULL,
	[EndOfPeriod08] [datetime] NOT NULL,
	[EndOfPeriod09] [datetime] NOT NULL,
	[EndOfPeriod10] [datetime] NOT NULL,
	[EndOfPeriod11] [datetime] NOT NULL,
	[EndOfPeriod12] [datetime] NOT NULL,
	[EndOfPeriod13] [datetime] NOT NULL,
	[EndOfPeriod14] [datetime] NOT NULL,
	[DatePatternType] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[Century] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGSAccountFiscalDatePatterns] PRIMARY KEY CLUSTERED 
(
	[FiscalDatePattern] ASC,
	[DateFiscalYearBegins] ASC,
	[FiscalQuarter] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSAccountFiscalDatePatterns] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSBatchControlRecords]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSBatchControlRecords]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSBatchControlRecords](
	[SourceID] [int] NOT NULL,
	[Source] [nchar](20) NOT NULL,
	[BatchType] [nchar](2) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchStatus] [nchar](1) NOT NULL,
	[BatchApprovedforPosting] [nchar](1) NOT NULL,
	[InputTotal] [decimal](20, 7) NOT NULL,
	[UserID] [nchar](10) NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[AmountNumberDocumentExpected] [int] NOT NULL,
	[BalancedDocumentsandAmounts] [nchar](1) NOT NULL,
	[BalancedJE] [nchar](1) NOT NULL,
	[AmountEntered] [decimal](20, 7) NOT NULL,
	[AmountDocumentsEntered] [decimal](20, 7) NOT NULL,
	[AuthorizedUserID] [nchar](10) NOT NULL,
	[PostOutofBalance] [nchar](1) NOT NULL,
	[IncludeBatchonIntegrityflag] [nchar](1) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeUpdated] [int] NOT NULL,
	[ProgramID] [nchar](10) NOT NULL,
	[WorkStationID] [nchar](10) NOT NULL,
	[AutoOffsetMode] [nchar](1) NOT NULL,
	[AmountInputTotal] [decimal](20, 7) NOT NULL,
	[DetailedRestatementProcessed] [nchar](1) NOT NULL,
	[CashBasisProcessed] [nchar](1) NOT NULL,
	[52PeriodProcessed] [nchar](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGSBatchControlRecords] PRIMARY KEY CLUSTERED 
(
	[BatchType] ASC,
	[BatchNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSBatchControlRecords] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSBusinessUnitMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSBusinessUnitMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSBusinessUnitMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Type] [char](2) NOT NULL,
	[BusinessUnitTypeDescription] [char](30) NOT NULL,
	[DescriptionCompressed] [char](40) NOT NULL,
	[LevelOfDetail] [char](1) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[OwnerReceivableAddress] [int] NOT NULL,
	[County] [char](3) NOT NULL,
	[StateCode] [char](3) NOT NULL,
	[ModelAccountConsolidations] [char](1) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[Description03] [char](30) NOT NULL,
	[Description04] [char](30) NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[Category01] [char](30) NOT NULL,
	[Category02Code] [char](3) NOT NULL,
	[Category02] [char](30) NOT NULL,
	[Category03Code] [char](3) NOT NULL,
	[Category03] [char](30) NOT NULL,
	[Category04Code] [char](3) NOT NULL,
	[Category04] [char](30) NOT NULL,
	[Category05Code] [char](3) NOT NULL,
	[Category05] [char](30) NOT NULL,
	[Category06Code] [char](3) NOT NULL,
	[Category06] [char](30) NOT NULL,
	[Category07Code] [char](3) NOT NULL,
	[Category07] [char](30) NOT NULL,
	[Category08Code] [char](3) NOT NULL,
	[Category08] [char](30) NOT NULL,
	[Category09Code] [char](3) NOT NULL,
	[Category09] [char](30) NOT NULL,
	[Category10Code] [char](3) NOT NULL,
	[Category10] [char](30) NOT NULL,
	[Category11Code] [char](3) NOT NULL,
	[Category11] [char](30) NOT NULL,
	[Category12Code] [char](3) NOT NULL,
	[Category12] [char](30) NOT NULL,
	[Category13Code] [char](3) NOT NULL,
	[Category13] [char](30) NOT NULL,
	[Category14Code] [char](3) NOT NULL,
	[Category14] [char](30) NOT NULL,
	[Category15Code] [char](3) NOT NULL,
	[Category15] [char](30) NOT NULL,
	[Category16Code] [char](3) NOT NULL,
	[Category16] [char](30) NOT NULL,
	[Category17Code] [char](3) NOT NULL,
	[Category17] [char](30) NOT NULL,
	[Category18Code] [char](3) NOT NULL,
	[Category18] [char](30) NOT NULL,
	[Category19Code] [char](3) NOT NULL,
	[Category19] [char](30) NOT NULL,
	[Category20Code] [char](3) NOT NULL,
	[Category20] [char](30) NOT NULL,
	[Category21Code] [char](10) NOT NULL,
	[Category21] [char](30) NOT NULL,
	[Category22Code] [char](10) NOT NULL,
	[Category22] [char](30) NOT NULL,
	[Category23Code] [char](10) NOT NULL,
	[Category23] [char](30) NOT NULL,
	[Category24Code] [char](10) NOT NULL,
	[Category24] [char](30) NOT NULL,
	[Category25Code] [char](10) NOT NULL,
	[Category25] [char](30) NOT NULL,
	[Category26Code] [char](10) NOT NULL,
	[Category26] [char](30) NOT NULL,
	[Category27Code] [char](10) NOT NULL,
	[Category27] [char](30) NOT NULL,
	[Category28Code] [char](10) NOT NULL,
	[Category28] [char](30) NOT NULL,
	[Category29Code] [char](10) NOT NULL,
	[Category29] [char](30) NOT NULL,
	[Category30Code] [char](10) NOT NULL,
	[Category30] [char](30) NOT NULL,
	[TaxArea] [char](10) NOT NULL,
	[TaxEntity] [int] NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[TaxDeduciton01Code] [char](4) NOT NULL,
	[TaxDeduciton02Code] [char](4) NOT NULL,
	[TaxDeduciton03Code] [char](4) NOT NULL,
	[TaxDeduciton04Code] [char](4) NOT NULL,
	[TaxDeduciton05Code] [char](4) NOT NULL,
	[TaxDeduciton06Code] [char](4) NOT NULL,
	[TaxDeduciton07Code] [char](4) NOT NULL,
	[TaxDeduciton08Code] [char](4) NOT NULL,
	[TaxDeduciton09Code] [char](4) NOT NULL,
	[TaxDeduciton10Code] [char](4) NOT NULL,
	[TaxDistributableYN01] [char](1) NOT NULL,
	[TaxDistributableYN02] [char](1) NOT NULL,
	[TaxDistributableYN03] [char](1) NOT NULL,
	[TaxDistributableYN04] [char](1) NOT NULL,
	[TaxDistributableYN05] [char](1) NOT NULL,
	[TaxDistributableYN06] [char](1) NOT NULL,
	[TaxDistributableYN07] [char](1) NOT NULL,
	[TaxDistributableYN08] [char](1) NOT NULL,
	[TaxDistributableYN09] [char](1) NOT NULL,
	[TaxDistributableYN10] [char](1) NOT NULL,
	[ComputeStatusCode01] [char](1) NOT NULL,
	[ComputeStatusCode02] [char](1) NOT NULL,
	[ComputeStatusCode03] [char](1) NOT NULL,
	[ComputeStatusCode04] [char](1) NOT NULL,
	[ComputeStatusCode05] [char](1) NOT NULL,
	[ComputeStatusCode06] [char](1) NOT NULL,
	[ComputeStatusCode07] [char](1) NOT NULL,
	[ComputeStatusCode08] [char](1) NOT NULL,
	[ComputeStatusCode09] [char](1) NOT NULL,
	[ComputeStatusCode10] [char](1) NOT NULL,
	[PostingEditCode] [char](1) NOT NULL,
	[PostingEditCodeDescription] [char](30) NOT NULL,
	[SummarizationMethod] [char](1) NOT NULL,
	[InvoiceStatementSummarization] [char](1) NOT NULL,
	[GLBankAccount] [char](8) NOT NULL,
	[AllocationLevel] [char](2) NOT NULL,
	[LaborDistributionMethod] [char](1) NOT NULL,
	[LaborDistributionMultiplier] [decimal](20, 7) NOT NULL,
	[LaborAccount] [char](6) NOT NULL,
	[PremiumAccount] [char](6) NOT NULL,
	[BurdenAccount] [char](6) NOT NULL,
	[SubsidiaryAccount] [char](8) NOT NULL,
	[TotalUnits] [decimal](20, 7) NOT NULL,
	[SubledgerInactiveCode] [char](1) NOT NULL,
	[Supervisor] [int] NOT NULL,
	[ContractType] [char](4) NOT NULL,
	[CeritifedJobYN] [char](1) NOT NULL,
	[ProjectNumber] [char](12) NOT NULL,
	[BillingType] [char](1) NOT NULL,
	[PercentComplete] [decimal](20, 7) NOT NULL,
	[PercentCompleteAggregateDetail] [decimal](20, 7) NOT NULL,
	[CostToComplete] [decimal](20, 7) NOT NULL,
	[InterestComputationCode] [char](4) NOT NULL,
	[InterestComputationCodeLateRev] [char](4) NOT NULL,
	[PlannedStartDate] [datetime] NOT NULL,
	[ActualStartDate] [datetime] NOT NULL,
	[PlannedCompletionDate] [datetime] NOT NULL,
	[ActualCompletionDate] [datetime] NOT NULL,
	[OtherDate05] [datetime] NOT NULL,
	[OtherDate06] [datetime] NOT NULL,
	[FinalPaymentDate] [datetime] NOT NULL,
	[CostAtCompletion] [decimal](20, 7) NOT NULL,
	[ProfitAtCompletion] [decimal](20, 7) NOT NULL,
	[EEOCodeYN] [char](1) NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[BranchType] [char](15) NOT NULL,
	[APSBusinessUnit] [char](10) NOT NULL,
	[TargetBusinessUnit] [char](12) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGSBusinessUnitMaster] PRIMARY KEY CLUSTERED 
(
	[BusinessUnitCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSBusinessUnitMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSCompanyMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSCompanyMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSCompanyMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[CompanyName] [char](30) NOT NULL,
	[AlternateCompanyName] [char](40) NOT NULL,
	[DateFiscalYearBegins] [datetime] NOT NULL,
	[CurrentPeriod] [int] NOT NULL,
	[AllowMultiCurrIntercoJEsYN] [char](1) NOT NULL,
	[MultiCurrencyConversion] [char](1) NOT NULL,
	[SearchTypeSecurityYN] [char](1) NOT NULL,
	[ComputationID] [char](1) NOT NULL,
	[DefaultAssetBU] [char](1) NOT NULL,
	[DefaultDepreciationBU] [char](1) NOT NULL,
	[DefaultAccumDepreciationBU] [char](1) NOT NULL,
	[DefaultRevenueBillingBU] [char](1) NOT NULL,
	[SymbolForStructuredCode] [char](1) NOT NULL,
	[BookForIncomeTax] [char](1) NOT NULL,
	[TaxYearBeginingPeriod] [int] NOT NULL,
	[TaxYearBeginingPeriodOld] [int] NOT NULL,
	[NewTaxYearEnd] [datetime] NOT NULL,
	[GLInterfaceYN] [char](1) NOT NULL,
	[StructuredAccountCodeYN] [char](1) NOT NULL,
	[NormalNumberOfPeriods] [char](2) NOT NULL,
	[FiscalDatePattern] [char](1) NOT NULL,
	[FinancialReportingPeriod] [int] NOT NULL,
	[FinancialReportingYear] [int] NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[SymbolForItemNumber] [char](1) NOT NULL,
	[SymbolForUnitTag] [char](1) NOT NULL,
	[SymbolForSerialTag] [char](1) NOT NULL,
	[DelinquencyNotice] [char](1) NOT NULL,
	[PrintStatements] [char](1) NOT NULL,
	[AutoCash] [char](1) NOT NULL,
	[AutoCashAlgorithm] [char](2) NOT NULL,
	[AgingMethod] [char](1) NOT NULL,
	[CurrentAgingDays] [int] NOT NULL,
	[AgingDays01] [int] NOT NULL,
	[AgingDays02] [int] NOT NULL,
	[AgingDays03] [int] NOT NULL,
	[AgingDays04] [int] NOT NULL,
	[AgingDays05] [int] NOT NULL,
	[AgingDays06] [int] NOT NULL,
	[AgingDays07] [int] NOT NULL,
	[FiftyTwoPeriodFinancialYear] [int] NOT NULL,
	[FiftyTwoPeriodFinancialPeriod] [int] NOT NULL,
	[FiftyTwoPeriodNormalNumPeriods] [int] NOT NULL,
	[PercentageFactor] [decimal](20, 7) NOT NULL,
	[AgingDate] [char](1) NOT NULL,
	[AgeAsOfDate] [datetime] NOT NULL,
	[CurrentPeriodAR] [int] NOT NULL,
	[CurrentPeriodAP] [int] NOT NULL,
	[BeginingFiscalYearAR] [datetime] NOT NULL,
	[BeginingFiscalYearAP] [datetime] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[SignatureBlock] [char](40) NOT NULL,
	[PrintCompanyName] [char](1) NOT NULL,
	[FutureUse01] [char](1) NOT NULL,
	[FutureUse02] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[TargetSystemIdentifier] [int] NOT NULL,
	[TargetCompany] [char](5) NOT NULL,
	[SourceAliasSystem] [char](10) NOT NULL,
	[TargetAddressNumber] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGSCompanyMaster] PRIMARY KEY CLUSTERED 
(
	[CompanyNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSCompanyMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSLibraryListsUser]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSLibraryListsUser]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSLibraryListsUser](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[MenuIdentification] [char](10) NOT NULL,
	[OutputQueue] [char](10) NOT NULL,
	[BatchJobQueue] [char](10) NOT NULL,
	[JobSchedulingPriority] [char](1) NOT NULL,
	[OutputPriority] [char](1) NOT NULL,
	[LoggingLevel] [char](1) NOT NULL,
	[LoggingSeverity] [char](2) NOT NULL,
	[LoggingMessages] [char](7) NOT NULL,
	[PrintFileLibrary] [char](10) NOT NULL,
	[UserLibraryList01] [char](10) NOT NULL,
	[UserLibraryList02] [char](10) NOT NULL,
	[UserLibraryList03] [char](10) NOT NULL,
	[UserLibraryList04] [char](10) NOT NULL,
	[UserLibraryList05] [char](10) NOT NULL,
	[UserLibraryList06] [char](10) NOT NULL,
	[UserLibraryList07] [char](10) NOT NULL,
	[UserLibraryList08] [char](10) NOT NULL,
	[UserLibraryList09] [char](10) NOT NULL,
	[UserLibraryList10] [char](10) NOT NULL,
	[UserLibraryList11] [char](10) NOT NULL,
	[UserLibraryList12] [char](10) NOT NULL,
	[UserLibraryList13] [char](10) NOT NULL,
	[UserLibraryList14] [char](10) NOT NULL,
	[UserLibraryList15] [char](10) NOT NULL,
	[UserLibraryList16] [char](10) NOT NULL,
	[UserLibraryList17] [char](10) NOT NULL,
	[UserLibraryList18] [char](10) NOT NULL,
	[UserLibraryList19] [char](10) NOT NULL,
	[UserLibraryList20] [char](10) NOT NULL,
	[UserLibraryList21] [char](10) NOT NULL,
	[UserLibraryList22] [char](10) NOT NULL,
	[UserLibraryList23] [char](10) NOT NULL,
	[UserLibraryList24] [char](10) NOT NULL,
	[UserLibraryList25] [char](10) NOT NULL,
	[AuthorizationMask] [char](1) NOT NULL,
	[JobMask] [char](1) NOT NULL,
	[KnowledgeMask] [char](1) NOT NULL,
	[DepartmentMask] [char](2) NOT NULL,
	[FutureUseMask] [char](1) NOT NULL,
	[AddressNumber] [numeric](8, 0) NOT NULL,
	[UserType] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[MenuTravel] [char](1) NOT NULL,
	[CommandEntry] [char](1) NOT NULL,
	[CurrentLibrary] [char](10) NOT NULL,
	[UserClassGroup] [char](10) NOT NULL,
	[InitialProgram] [char](10) NOT NULL,
	[MenuLevel] [char](1) NOT NULL,
	[AllowFastPath(Y/N)] [char](1) NOT NULL,
 CONSTRAINT [PK_JDEGSLibraryListsUser_1] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSLibraryListsUser] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSPaymentTerms]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSPaymentTerms]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSPaymentTerms](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[Description] [char](30) NOT NULL,
	[DiscountPercent] [decimal](15, 5) NOT NULL,
	[DiscountDays] [int] NOT NULL,
	[NetDaysToPay] [int] NOT NULL,
	[DueDate] [datetime] NOT NULL,
	[NumberOfSplitPayments] [int] NOT NULL,
	[DaysToPayAging] [int] NOT NULL,
	[EffectiveInterestRate] [decimal](15, 3) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[ProxDateMonth] [int] NOT NULL,
	[ProxDateDay] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGSPaymentTerms] PRIMARY KEY CLUSTERED 
(
	[PaymentTerms] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSPaymentTerms] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSSecurityWorkbench]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSSecurityWorkbench]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSSecurityWorkbench](
	[SecurityType] [char](1) NOT NULL,
	[UserId] [char](10) NOT NULL,
	[NameObject] [char](10) NOT NULL,
	[DataItem] [char](10) NOT NULL,
	[FromDataValue] [char](30) NOT NULL,
	[ProductCode] [char](4) NOT NULL,
	[DataItemLong] [char](40) NOT NULL,
	[FormName] [char](10) NOT NULL,
	[FunctionCodeOpenSystems] [char](4) NOT NULL,
	[InstallApplicationYN] [char](1) NOT NULL,
	[RunApplicationYN] [char](1) NOT NULL,
	[ViewDataYN] [char](1) NOT NULL,
	[AdditionFlag] [char](1) NOT NULL,
	[ChangeYN] [char](1) NOT NULL,
	[DeleteYN] [char](1) NOT NULL,
	[ThruDataValue] [char](30) NOT NULL,
	[ObjectIdentifier] [decimal](31, 0) NOT NULL,
	[AddOrChange] [char](1) NOT NULL,
	[OKSelectAction] [char](1) NOT NULL,
	[CopyAction] [char](1) NOT NULL,
	[UpdateAction] [char](1) NOT NULL,
	[ReserveAction] [char](1) NOT NULL,
	[ReserveAction2] [char](1) NOT NULL,
	[ReserveAction3] [char](1) NOT NULL,
	[RecordUpdateByUserNa] [char](10) NOT NULL,
	[ProgramId] [char](10) NOT NULL,
	[WorkStationId] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeLastUpdated] [numeric](6, 0) NOT NULL,
	[ExitIdentifier] [decimal](31, 0) NOT NULL,
	[TabIdentifier] [decimal](31, 0) NOT NULL,
	[TextIDEverest] [decimal](31, 0) NOT NULL,
	[Path] [char](120) NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
 CONSTRAINT [PK_JDESESecurityWorkbench] PRIMARY KEY CLUSTERED 
(
	[SecurityType] ASC,
	[UserId] ASC,
	[NameObject] ASC,
	[DataItem] ASC,
	[FromDataValue] ASC,
	[ProductCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSSecurityWorkbench] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSSupplementalData]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSSupplementalData]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSSupplementalData](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[SupplementalDatabaseCode] [char](4) NOT NULL,
	[TypeData] [char](2) NOT NULL,
	[SupplementalDataAlphaKey1] [char](10) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[SupplementalDataAlphaKey2] [char](10) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[SupplementalDataNumericKey1] [int] NOT NULL,
	[SupplementatDataNumericKey2] [int] NOT NULL,
	[UniqueKeyIDInternal] [decimal](15, 0) NOT NULL,
	[QuantityOrdered] [decimal](20, 7) NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[UserDefinedCodesValues] [char](10) NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[AmountUserDefined] [decimal](20, 7) NOT NULL,
	[AmountUserDefined02] [decimal](20, 7) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[NameRemark] [char](30) NOT NULL,
	[DateAdditional] [datetime] NOT NULL,
	[DaysUserDefined] [int] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[UDCEquivalentforWorldWriter] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[TextRemark] [char](50) NOT NULL,
	[TimeAdditional] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGSSupplementalData] PRIMARY KEY CLUSTERED 
(
	[SupplementalDatabaseCode] ASC,
	[TypeData] ASC,
	[SupplementalDataAlphaKey1] ASC,
	[DocumentCompany] ASC,
	[SupplementalDataAlphaKey2] ASC,
	[BusinessUnitCode] ASC,
	[SupplementalDataNumericKey1] ASC,
	[SupplementatDataNumericKey2] ASC,
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSSupplementalData] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSUserDefinedCodes]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSUserDefinedCodes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSUserDefinedCodes](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[InstallSystemCode] [char](4) NOT NULL,
	[UserDefinedCode] [char](2) NOT NULL,
	[UserDefinedCodesValues] [char](10) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[SpecialHandlingCode] [char](10) NOT NULL,
	[OwnershipFlag] [char](1) NOT NULL,
	[HardCodedYN] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGSUserDefinedCodes] PRIMARY KEY CLUSTERED 
(
	[InstallSystemCode] ASC,
	[UserDefinedCode] ASC,
	[UserDefinedCodesValues] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSUserDefinedCodes] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEGSUserDefinedCodeTypes]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSUserDefinedCodeTypes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEGSUserDefinedCodeTypes](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[InstallSystemCode] [char](4) NOT NULL,
	[UserDefinedCode] [char](2) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[SequenceNumber] [decimal](20, 7) NOT NULL,
	[ClassCode] [char](3) NOT NULL,
	[CodeLength] [int] NOT NULL,
	[Line2DesiredYN] [char](1) NOT NULL,
	[NumericYN] [char](1) NOT NULL,
	[JDEMergeControl] [char](1) NOT NULL,
	[MergeType] [char](2) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEGSUserDefinedCodeTypes] PRIMARY KEY CLUSTERED 
(
	[InstallSystemCode] ASC,
	[UserDefinedCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEGSUserDefinedCodeTypes] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRApplicantMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRApplicantMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRApplicantMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[StatusApplicant] [char](2) NOT NULL,
	[EmployeeTaxID] [char](20) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[PositionID] [char](8) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[JobCategoryEEO] [char](3) NOT NULL,
	[EthnicCode] [char](2) NOT NULL,
	[GenderMaleFemale] [char](1) NOT NULL,
	[EEOI9Status] [char](1) NOT NULL,
	[EEOVeteran] [char](1) NOT NULL,
	[EEODisabledVeteran] [char](1) NOT NULL,
	[EEODisability] [char](1) NOT NULL,
	[CategoryCodeApplicantI05] [char](1) NOT NULL,
	[CategoryCodeApplicantI06] [char](1) NOT NULL,
	[CategoryCodeApplicantI07] [char](1) NOT NULL,
	[CategoryCodeApplicantI08] [char](1) NOT NULL,
	[CategoryCodeApplicantI09] [char](1) NOT NULL,
	[CategoryCodeApplicantI10] [char](1) NOT NULL,
	[ApplicantSourceofReference] [char](3) NOT NULL,
	[ApplicantApplicationMethod] [char](3) NOT NULL,
	[ApplicantInterviewer] [char](3) NOT NULL,
	[ApplicantBranchLocation] [char](3) NOT NULL,
	[CategoryCodeApplicantII05] [char](3) NOT NULL,
	[CategoryCodeApplicantII06] [char](3) NOT NULL,
	[CategoryCodeApplicantII07] [char](3) NOT NULL,
	[CategoryCodeApplicantII08] [char](3) NOT NULL,
	[CategoryCodeApplicantII09] [char](3) NOT NULL,
	[CategoryCodeApplicantII10] [char](3) NOT NULL,
	[DateBirth] [datetime] NOT NULL,
	[DateApplication] [datetime] NOT NULL,
	[DateRecruitingEnd] [datetime] NOT NULL,
	[DateFirstInterview] [datetime] NOT NULL,
	[DateAvailabletoBegin] [datetime] NOT NULL,
	[RateSalaryAsking] [decimal](20, 7) NOT NULL,
	[HoursAvailabletoWork] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[HomeBusinessUnit] [char](12) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRApplicantMaster] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRApplicantMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRBenefitsPlanMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRBenefitsPlanMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRBenefitsPlanMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[PlanID] [char](8) NOT NULL,
	[ExplanationDescription] [char](30) NOT NULL,
	[DescriptionCompressed] [char](40) NOT NULL,
	[AddressNumberProviderTrustee] [int] NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[StatusCode] [char](1) NOT NULL,
	[PlanType] [char](2) NOT NULL,
	[TransCodeBeneficiaryFlag] [char](1) NOT NULL,
	[PolicyReferenceNumber] [char](30) NOT NULL,
	[AmountCoverage] [decimal](20, 7) NOT NULL,
	[AmountPremiumPayment] [decimal](20, 7) NOT NULL,
	[VestingTable] [char](5) NOT NULL,
	[PercentageEmployee] [int] NOT NULL,
	[EmployeeDBAID] [int] NOT NULL,
	[PercentageEmployer] [int] NOT NULL,
	[EmployerDBAID] [int] NOT NULL,
	[MandatoryParticipation] [char](1) NOT NULL,
	[PerCoverageDollars] [int] NOT NULL,
	[SalaryFactor] [decimal](20, 7) NOT NULL,
	[TableCode] [char](5) NOT NULL,
	[PayrollDBAForDeductionPoints] [int] NOT NULL,
	[PayrollDBAForCreditPoints] [int] NOT NULL,
	[FlexorSpendingAccountType] [char](1) NOT NULL,
	[VestingCalculationRule] [char](2) NOT NULL,
	[PayTypeTable] [char](4) NOT NULL,
	[VestingMinimumHours] [int] NOT NULL,
	[VestingComputationPeriod] [char](1) NOT NULL,
	[Category01CodePlanMaster] [char](3) NOT NULL,
	[Category01PlanMaster] [char](30) NOT NULL,
	[Category02CodePlanMaster] [char](3) NOT NULL,
	[Category02PlanMaster] [char](30) NOT NULL,
	[Category03CodePlanMaster] [char](3) NOT NULL,
	[Category03PlanMaster] [char](30) NOT NULL,
	[Category04CodePlanMaster] [char](3) NOT NULL,
	[Category04PlanMaster] [char](30) NOT NULL,
	[Category05CodePlanMaster] [char](3) NOT NULL,
	[Category05PlanMaster] [char](30) NOT NULL,
	[Category06CodePlanMaster] [char](3) NOT NULL,
	[Category06PlanMaster] [char](30) NOT NULL,
	[Category07CodePlanMaster] [char](3) NOT NULL,
	[Category07PlanMaster] [char](30) NOT NULL,
	[Category08CodePlanMaster] [char](3) NOT NULL,
	[Category08PlanMaster] [char](30) NOT NULL,
	[Category09CodePlanMaster] [char](3) NOT NULL,
	[Category09PlanMaster] [char](30) NOT NULL,
	[Category10CodePlanMaster] [char](3) NOT NULL,
	[Category10PlanMaster] [char](30) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[EligibilityTable1] [char](4) NOT NULL,
	[EligibilityTable2] [char](4) NOT NULL,
	[AmountorRate] [char](1) NOT NULL,
	[AgeRateFlagForEnrollment] [char](1) NOT NULL,
	[PlanPrerequisite] [char](8) NOT NULL,
	[AmountMaximumPremium] [decimal](20, 7) NOT NULL,
	[AmountRounding] [decimal](20, 7) NOT NULL,
	[TransfertoCOBRA] [char](1) NOT NULL,
	[Secondary401kPlan] [char](8) NOT NULL,
	[FlexorSpendingAccountType01] [char](1) NOT NULL,
	[PayTypeforFlexibleSpendingAccts] [int] NOT NULL,
	[EEPointsAllowanceforFlexBenefits] [char](1) NOT NULL,
	[PrerequisitePlanType] [char](2) NOT NULL,
	[FlagEmployeeEmployer01] [char](1) NOT NULL,
	[FlagEmployeeEmployer02] [char](1) NOT NULL,
	[FlagEmployeeEmployer03] [char](1) NOT NULL,
	[FlagEmployeeEmployer04] [char](1) NOT NULL,
	[FlagPointsMoney01] [char](1) NOT NULL,
	[FlagPointsMoney02] [char](1) NOT NULL,
	[FlagPointsMoney03] [char](1) NOT NULL,
	[FlagPointsMoney04] [char](1) NOT NULL,
	[FlagRateEntry01] [char](1) NOT NULL,
	[FlagRateEntry02] [char](1) NOT NULL,
	[FlagRateEntry03] [char](1) NOT NULL,
	[FlagRateEntry04] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRBenefitsPlanMaster] PRIMARY KEY CLUSTERED 
(
	[PlanID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRBenefitsPlanMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRDepBenToEmployeePlanXRef]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRDepBenToEmployeePlanXRef]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRDepBenToEmployeePlanXRef](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PlanID] [char](8) NOT NULL,
	[PlanAdditionalOption] [char](3) NOT NULL,
	[ParticipantAddressNumber] [int] NOT NULL,
	[DependentBeneficiaryRelationship] [char](1) NOT NULL,
	[DependentBeneficiary] [char](1) NOT NULL,
	[TypeDependentBeneficiary] [char](2) NOT NULL,
	[PercentageBeneficiary] [int] NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRDepBenToEmployeePlanXRef] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[PlanID] ASC,
	[PlanAdditionalOption] ASC,
	[ParticipantAddressNumber] ASC,
	[EffectiveDate] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRDepBenToEmployeePlanXRef] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHREmployeeEnrollment]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHREmployeeEnrollment]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHREmployeeEnrollment](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PlanID] [char](8) NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[StatusEnrollment] [char](3) NOT NULL,
	[StatusEndingEnrollment] [char](3) NOT NULL,
	[DateOriginalEligibility] [datetime] NOT NULL,
	[DateOriginalParticipation] [datetime] NOT NULL,
	[DateUserDefined] [datetime] NOT NULL,
	[PlanAdditionalOption] [char](3) NOT NULL,
	[Factor] [int] NOT NULL,
	[DateDBABegins] [datetime] NOT NULL,
	[DateDBAEnds] [datetime] NOT NULL,
	[SequenceNumberforView] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHREmployeeEnrollment] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[PlanID] ASC,
	[EffectiveDate] ASC,
	[PlanAdditionalOption] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHREmployeeEnrollment] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRHRGeneralDescriptionNarr]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRHRGeneralDescriptionNarr]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRHRGeneralDescriptionNarr](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[HRDataBase] [char](1) NOT NULL,
	[TypeDataApplicant] [char](2) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[UserDefinedCodesValues] [char](10) NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[LineNumberGeneral] [decimal](20, 7) NOT NULL,
	[Description] [char](80) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRHRGeneralDescriptionNarr] PRIMARY KEY CLUSTERED 
(
	[HRDataBase] ASC,
	[TypeDataApplicant] ASC,
	[AddressNumber] ASC,
	[JobType] ASC,
	[JobStep] ASC,
	[UserDefinedCodesValues] ASC,
	[EffectiveDate] ASC,
	[LineNumberGeneral] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRHRGeneralDescriptionNarr] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRHRGeneralDescriptionUDC]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRHRGeneralDescriptionUDC]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRHRGeneralDescriptionUDC](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[HRDataBase] [char](1) NOT NULL,
	[TypeDataApplicant] [char](2) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[UserDefinedCodesValues] [char](10) NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[TickleDate] [datetime] NOT NULL,
	[AmountUserDefined] [decimal](20, 7) NOT NULL,
	[AmountUserDefined02] [decimal](20, 7) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[NameRemarksLine02] [char](30) NOT NULL,
	[UDCEquivalentforWorldWriter] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRHRGeneralDescriptionUDC] PRIMARY KEY CLUSTERED 
(
	[HRDataBase] ASC,
	[TypeDataApplicant] ASC,
	[AddressNumber] ASC,
	[JobType] ASC,
	[JobStep] ASC,
	[UserDefinedCodesValues] ASC,
	[EffectiveDate] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRHRGeneralDescriptionUDC] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRHRMSupplementalDataTypes]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRHRMSupplementalDataTypes]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRHRMSupplementalDataTypes](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[HRDataBase] [char](1) NOT NULL,
	[TypeDataApplicant] [char](2) NOT NULL,
	[DisplayModeCodeorNarrative] [char](1) NOT NULL,
	[SequenceNumberforView] [int] NOT NULL,
	[Description01] [char](30) NOT NULL,
	[InstallSystemCode] [char](4) NOT NULL,
	[UserDefinedCode] [char](2) NOT NULL,
	[UserDefinedCodeTitle] [char](10) NOT NULL,
	[UserDefinedAmountTitle] [char](10) NOT NULL,
	[Remark1ColumnTitle] [char](30) NOT NULL,
	[Remark2ColumnTitle] [char](30) NOT NULL,
	[Date1ColumnTitle] [char](10) NOT NULL,
	[Date2ColumnTitle] [char](10) NOT NULL,
	[Amount2RowTitle] [char](10) NOT NULL,
	[SystemCode01] [char](4) NOT NULL,
	[UserDefinedCodes01] [char](2) NOT NULL,
	[SystemCode02] [char](4) NOT NULL,
	[UserDefinedCodes02] [char](2) NOT NULL,
	[TypeDataGroupingCode] [char](3) NOT NULL,
	[SystemDateDefaultFlag] [char](1) NOT NULL,
	[SearchTypeCode] [char](3) NOT NULL,
	[DataTypeClassification] [char](4) NOT NULL,
	[ProgramName] [char](10) NOT NULL,
	[VersionHistory] [char](10) NOT NULL,
	[GenericProgramName] [char](10) NOT NULL,
	[FileName] [char](10) NOT NULL,
	[DisplaySequence] [int] NOT NULL,
	[CodeFunction] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRHRMSupplementalDataTypes] PRIMARY KEY CLUSTERED 
(
	[HRDataBase] ASC,
	[TypeDataApplicant] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRHRMSupplementalDataTypes] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRJobinformation]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRJobinformation]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRJobinformation](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[JobGroup] [char](6) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[PayClassHSP] [char](1) NOT NULL,
	[PayGrade] [char](6) NOT NULL,
	[PayFrequency] [char](1) NOT NULL,
	[JobCategoryEEO] [char](3) NOT NULL,
	[WorkersComp] [char](4) NOT NULL,
	[SubClassWorkersComp] [char](1) NOT NULL,
	[FLSAExemptYN] [char](1) NOT NULL,
	[BenefitGroup] [char](6) NOT NULL,
	[UnionCode] [char](6) NOT NULL,
	[JobEvaluationMethod] [char](4) NOT NULL,
	[DateJobEvaluationJulian] [datetime] NOT NULL,
	[JobEvaluationPoints] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr001] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr002] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr003] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr004] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr005] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr006] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr007] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr008] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr009] [int] NOT NULL,
	[JobEvaluationFactorPointsinDegr010] [int] NOT NULL,
	[JobEvaluationPointsperFactor01] [int] NOT NULL,
	[JobEvaluationPointsperFactor02] [int] NOT NULL,
	[JobEvaluationPointsperFactor03] [int] NOT NULL,
	[JobEvaluationPointsperFactor04] [int] NOT NULL,
	[JobEvaluationPointsperFactor05] [int] NOT NULL,
	[JobEvaluationPointsperFactor06] [int] NOT NULL,
	[JobEvaluationPointsperFactor07] [int] NOT NULL,
	[JobEvaluationPointsperFactor08] [int] NOT NULL,
	[JobEvaluationPointsperFactor09] [int] NOT NULL,
	[JobEvaluationPointsperFactor10] [int] NOT NULL,
	[Category01CodePayroll] [char](3) NOT NULL,
	[Category01Payroll] [char](30) NOT NULL,
	[Category02CodePayroll] [char](3) NOT NULL,
	[Category02Payroll] [char](30) NOT NULL,
	[Category03CodePayroll] [char](3) NOT NULL,
	[Category03Payroll] [char](30) NOT NULL,
	[Category04CodePayroll] [char](3) NOT NULL,
	[Category04Payroll] [char](30) NOT NULL,
	[Category05CodePayroll] [char](3) NOT NULL,
	[Category05Payroll] [char](30) NOT NULL,
	[Category06CodePayroll] [char](3) NOT NULL,
	[Category06Payroll] [char](30) NOT NULL,
	[Category07CodePayroll] [char](3) NOT NULL,
	[Category07Payroll] [char](30) NOT NULL,
	[Category08CodePayroll] [char](3) NOT NULL,
	[Category08Payroll] [char](30) NOT NULL,
	[Category09CodePayroll] [char](3) NOT NULL,
	[Category09Payroll] [char](30) NOT NULL,
	[Category10CodePayroll] [char](3) NOT NULL,
	[Category10Payroll] [char](30) NOT NULL,
	[FactorEvaluationCode1] [char](10) NOT NULL,
	[FactorEvaluationCode2] [char](10) NOT NULL,
	[FactorEvaluationCode3] [char](10) NOT NULL,
	[FactorEvaluationCode4] [char](10) NOT NULL,
	[FactorEvaluationCode5] [char](10) NOT NULL,
	[FactorEvaluationCode6] [char](10) NOT NULL,
	[FactorEvaluationCode7] [char](10) NOT NULL,
	[FactorEvaluationCode8] [char](10) NOT NULL,
	[FactorEvaluationCode9] [char](10) NOT NULL,
	[FactorEvaluationCode10] [char](10) NOT NULL,
	[FactorWeight1] [decimal](20, 7) NOT NULL,
	[FactorWeight2] [decimal](20, 7) NOT NULL,
	[FactorWeight3] [decimal](20, 7) NOT NULL,
	[FactorWeight4] [decimal](20, 7) NOT NULL,
	[FactorWeight5] [decimal](20, 7) NOT NULL,
	[FactorWeight6] [decimal](20, 7) NOT NULL,
	[FactorWeight7] [decimal](20, 7) NOT NULL,
	[FactorWeight8] [decimal](20, 7) NOT NULL,
	[FactorWeight9] [decimal](20, 7) NOT NULL,
	[FactorWeight10] [decimal](20, 7) NOT NULL,
	[JobStatusCode] [char](3) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[PayGradeStep] [char](4) NOT NULL,
	[NOCCanEmpEquity] [char](4) NOT NULL,
	[StatusChangeReason] [char](3) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRJobinformation] PRIMARY KEY CLUSTERED 
(
	[JobType] ASC,
	[JobStep] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRJobinformation] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRPlanAdditionalOptions]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRPlanAdditionalOptions]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRPlanAdditionalOptions](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[PlanID] [char](8) NOT NULL,
	[PlanAdditionalOption] [char](3) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[EmployeeDBAID] [int] NOT NULL,
	[AmountAdditionalEmployeeShare] [decimal](20, 7) NOT NULL,
	[OptionRule1] [char](1) NOT NULL,
	[EmployerDBAID] [int] NOT NULL,
	[AmountAdditionalEmployerShare] [decimal](20, 7) NOT NULL,
	[OptionRule2] [char](1) NOT NULL,
	[PayrollDBAForDeductionPoints] [int] NOT NULL,
	[AmountAdditionalEmployeePoints] [decimal](20, 7) NOT NULL,
	[OptionRule3] [char](1) NOT NULL,
	[PayrollDBAForCreditPoints] [int] NOT NULL,
	[AmountAdditionalEmployerPoints] [decimal](20, 7) NOT NULL,
	[OptionRule4] [char](1) NOT NULL,
	[DefaultOption] [char](1) NOT NULL,
	[ValidOption] [char](1) NOT NULL,
	[TransCodeBeneficiaryFlag] [char](1) NOT NULL,
	[AmountPremiumPayment] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRPlanAdditionalOptions] PRIMARY KEY CLUSTERED 
(
	[PlanID] ASC,
	[PlanAdditionalOption] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRPlanAdditionalOptions] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRPlanMasterRates]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRPlanMasterRates]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRPlanMasterRates](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[PlanID] [char](8) NOT NULL,
	[PlanAdditionalOption] [char](3) NOT NULL,
	[DBACode] [int] NOT NULL,
	[PlanType] [char](1) NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[AmountorRate] [decimal](20, 7) NOT NULL,
	[StatusCode] [char](2) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[DataItem] [char](4) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRPlanMasterRates] PRIMARY KEY CLUSTERED 
(
	[PlanID] ASC,
	[PlanAdditionalOption] ASC,
	[DBACode] ASC,
	[PlanType] ASC,
	[DateEndingEffective] ASC,
	[DataItem] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRPlanMasterRates] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEHRPlanMasterText]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEHRPlanMasterText]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEHRPlanMasterText](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[PlanID] [char](8) NOT NULL,
	[LineNumberGeneral] [decimal](20, 7) NOT NULL,
	[Description] [char](80) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEHRPlanMasterText] PRIMARY KEY CLUSTERED 
(
	[PlanID] ASC,
	[LineNumberGeneral] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEHRPlanMasterText] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEIBDistributionMFGAAIValue]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEIBDistributionMFGAAIValue]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEIBDistributionMFGAAIValue](
	[SourceID] [int] NOT NULL,
	[Source] [nchar](20) NOT NULL,
	[NumberAAITableNumber] [int] NOT NULL,
	[CompanyNumber] [nchar](5) NOT NULL,
	[OrderTypeCode] [nchar](2) NOT NULL,
	[DocumentType] [nchar](2) NOT NULL,
	[GLCategory] [nchar](4) NOT NULL,
	[CostType] [nchar](3) NOT NULL,
	[BusinessUnitCode] [nchar](12) NOT NULL,
	[ObjectAccount] [nchar](6) NOT NULL,
	[Subsidiary] [nchar](8) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEIBDistributionManufacturingAAIValues] PRIMARY KEY CLUSTERED 
(
	[NumberAAITableNumber] ASC,
	[CompanyNumber] ASC,
	[OrderTypeCode] ASC,
	[DocumentType] ASC,
	[GLCategory] ASC,
	[CostType] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[JDEIBDistributionMFGAAIValue] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINBasePrice]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINBasePrice]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINBasePrice](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ItemCustomerKeyID] [int] NOT NULL,
	[LotGrade] [char](3) NOT NULL,
	[FromPotency] [decimal](20, 7) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[ExpiredDate] [datetime] NOT NULL,
	[UnitPrice] [decimal](20, 7) NOT NULL,
	[CreditPrice] [decimal](20, 7) NOT NULL,
	[Basis] [char](1) NOT NULL,
	[CostMethodCode] [char](2) NOT NULL,
	[CostMethod] [char](30) NOT NULL,
	[FactorValue] [decimal](20, 7) NOT NULL,
	[FormulaName] [char](10) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[ItemGroupKeyID] [int] NOT NULL,
	[CustomerGroupKeyID] [int] NOT NULL,
	[ApprovalStatus] [char](2) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINBasePrice] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[Location] ASC,
	[LotNumber] ASC,
	[AddressNumber] ASC,
	[LotGrade] ASC,
	[FromPotency] ASC,
	[CurrencyCode] ASC,
	[UnitOfMeasureAsInput] ASC,
	[ExpiredDate] ASC,
	[DateUpdated] ASC,
	[TimeOfDay] ASC,
	[ItemGroupKeyID] ASC,
	[CustomerGroupKeyID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINBasePrice] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINBasePriceAdjustmentDtail]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINBasePriceAdjustmentDtail]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINBasePriceAdjustmentDtail](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AdjustmentName] [char](8) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ItemCustomerKeyID] [int] NOT NULL,
	[OrderDetailGroup] [char](8) NOT NULL,
	[SalesDetailValue01] [char](12) NOT NULL,
	[SalesDetailValue02] [char](12) NOT NULL,
	[SalesDetailValue03] [char](8) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[QuantityFrom] [decimal](15, 0) NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[ExpiredDate] [datetime] NOT NULL,
	[Basis] [char](1) NOT NULL,
	[CostMethodCode] [char](2) NOT NULL,
	[FormulaName] [char](10) NOT NULL,
	[FactorValue] [decimal](15, 4) NOT NULL,
	[FreeGoods] [char](1) NOT NULL,
	[PriceAdjustmentKeyID] [int] NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[ItemGroupKeyID] [int] NOT NULL,
	[CustomerGroupKeyID] [int] NOT NULL,
	[OrderGroupKeyID] [int] NOT NULL,
	[NumberofOrders] [int] NOT NULL,
	[UnitofMeasureVolumeIncentives] [char](4) NOT NULL,
	[FactorValueUnitofMeasure] [char](4) NOT NULL,
	[PricePartialQuantitesFlag] [char](2) NOT NULL,
	[ApprovalStatus] [char](2) NOT NULL,
	[BasketParentID] [int] NOT NULL,
	[CurrencyCodeVolumeIncentives] [char](6) NOT NULL,
	[RoundingRuleName] [char](20) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINBasePriceAdjustmentDtail  ] PRIMARY KEY CLUSTERED 
(
	[AdjustmentName] ASC,
	[ItemNumber] ASC,
	[AddressNumber] ASC,
	[CurrencyCode] ASC,
	[UnitOfMeasureAsInput] ASC,
	[QuantityFrom] ASC,
	[ExpiredDate] ASC,
	[DateUpdated] ASC,
	[TimeOfDay] ASC,
	[ItemGroupKeyID] ASC,
	[CustomerGroupKeyID] ASC,
	[OrderGroupKeyID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINBasePriceAdjustmentDtail] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINBranchPlantConstants]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINBranchPlantConstants]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINBranchPlantConstants](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[InstallSystemCode] [char](4) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[GeneralLedgerExplanation] [char](1) NOT NULL,
	[SymbolToIdentifyShortInvNo] [char](1) NOT NULL,
	[SymbolToIdentifyLongInvNo] [char](1) NOT NULL,
	[SymbolToIdentify3rdInvNo] [char](1) NOT NULL,
	[SymbolToIdentifyCustomerNo] [char](1) NOT NULL,
	[ConfiguratorSegmentDelimiter] [char](1) NOT NULL,
	[LocationSeparatorcharacter] [char](1) NOT NULL,
	[NumberofcharactersAisle] [int] NOT NULL,
	[NumberofcharactersBin] [int] NOT NULL,
	[NumberofcharactersCode03] [int] NOT NULL,
	[NumberofcharactersCode04] [int] NOT NULL,
	[NumberofcharactersCode05] [int] NOT NULL,
	[NumberofcharactersCode06] [int] NOT NULL,
	[NumberofcharactersCode07] [int] NOT NULL,
	[NumberofcharactersCode08] [int] NOT NULL,
	[NumberofcharactersCode09] [int] NOT NULL,
	[NumberofcharactersCode10] [int] NOT NULL,
	[JustifyAisle] [char](1) NOT NULL,
	[JustifyBin] [char](1) NOT NULL,
	[JustifyCode03] [char](1) NOT NULL,
	[JustifyCode04] [char](1) NOT NULL,
	[JustifyCode05] [char](1) NOT NULL,
	[JustifyCode06] [char](1) NOT NULL,
	[JustifyCode07] [char](1) NOT NULL,
	[JustifyCode08] [char](1) NOT NULL,
	[JustifyCode09] [char](1) NOT NULL,
	[JustifyCode10] [char](1) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PurchaseOrderIssueCost] [decimal](20, 7) NOT NULL,
	[InventoryCarryingCost] [decimal](20, 7) NOT NULL,
	[LeadtimeWeightFactor] [decimal](20, 7) NOT NULL,
	[NumberOfDaysInYear] [int] NOT NULL,
	[ABCCode1Sales] [decimal](20, 7) NOT NULL,
	[ABCCode1GrossMargin] [decimal](20, 7) NOT NULL,
	[ABCCode1AverageInvestment] [decimal](20, 7) NOT NULL,
	[ABCCode2Sales] [decimal](20, 7) NOT NULL,
	[ABCCode2GrossMargin] [decimal](20, 7) NOT NULL,
	[ABCCode2AverageInvestment] [decimal](20, 7) NOT NULL,
	[ABCCode3Sales] [decimal](20, 7) NOT NULL,
	[ABCCode3GrossMargin] [decimal](20, 7) NOT NULL,
	[ABCCode3AverageInvestment] [decimal](20, 7) NOT NULL,
	[CurrentPeriod] [int] NOT NULL,
	[InterfaceGL] [char](1) NOT NULL,
	[WriteUnitstoJournalEntries] [char](1) NOT NULL,
	[CommitmentMethod] [char](1) NOT NULL,
	[SalesCostingMethod] [char](2) NOT NULL,
	[PurchasingCostingMethod] [char](2) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[SpecificCommitmentDays] [int] NOT NULL,
	[BatchControlRequired] [char](1) NOT NULL,
	[ManagerApprovalOfInput] [char](1) NOT NULL,
	[MatchType] [char](1) NOT NULL,
	[CrossReferenceTypeCode1] [char](2) NOT NULL,
	[CrossReferenceTypeCode2] [char](2) NOT NULL,
	[ApprovalRouteCode] [char](12) NOT NULL,
	[QuantitySoftCommittedToSO] [char](1) NOT NULL,
	[QuantityHardCommittedToSO] [char](1) NOT NULL,
	[QuantityFutureCommittedToSO] [char](1) NOT NULL,
	[QuantityHardCommittedToWO] [char](1) NOT NULL,
	[OtherQuantity1SO] [char](1) NOT NULL,
	[OtherQuantity2SO] [char](1) NOT NULL,
	[QuantityOnHold] [char](1) NOT NULL,
	[QuantityOnPOReceipts] [char](1) NOT NULL,
	[QuantityOnWOReceipts] [char](1) NOT NULL,
	[OtherQuantity1PO] [char](1) NOT NULL,
	[QuantityOnSafetyStock] [char](1) NOT NULL,
	[QuantityInInspection] [char](1) NOT NULL,
	[QuantityInTransit] [char](1) NOT NULL,
	[QuantityInOperation1] [char](1) NOT NULL,
	[QuantityInOperation2] [char](1) NOT NULL,
	[QuantityOnLoanToManufacturing] [char](1) NOT NULL,
	[UpdateLastInCost] [char](1) NOT NULL,
	[DimensionUnitOfMeasure] [char](2) NOT NULL,
	[VolumeDisplayedUOM] [char](2) NOT NULL,
	[UnitOfMeasureWeight] [char](2) NOT NULL,
	[AllowDuplicateLots] [char](1) NOT NULL,
	[LocationControl] [char](1) NOT NULL,
	[WarehouseControl] [char](1) NOT NULL,
	[InclusionVersion] [char](3) NOT NULL,
	[ShippingLocation] [char](20) NOT NULL,
	[ReceivingLocation] [char](20) NOT NULL,
	[TemperatureType] [char](1) NOT NULL,
	[DensityType] [char](1) NOT NULL,
	[StandardTemperature] [decimal](20, 7) NOT NULL,
	[USorMetricMeasurement] [char](1) NOT NULL,
	[PotencyControl] [char](1) NOT NULL,
	[GradeControl] [char](1) NOT NULL,
	[ForeignDepot] [char](1) NOT NULL,
	[QualityControl] [char](1) NOT NULL,
	[FutureUse] [char](1) NOT NULL,
	[USIncrementsDelimeter] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[InventoryLotCreationYN] [char](1) NOT NULL,
	[LocationSegmentControlYNInv] [char](1) NOT NULL,
	[SeparatorSegment] [char](1) NOT NULL,
	[SymboltoIdentifySegmentedItem] [char](1) NOT NULL,
	[LotAuditFlag] [char](1) NOT NULL,
	[SpecialLotFormat] [char](1) NOT NULL,
	[RestrictWorkOrderLotAssignment] [char](1) NOT NULL,
	[LotNumberPreAssignment] [char](1) NOT NULL,
	[BranchCountryOfOriginCode] [char](3) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINBranchPlantConstants] PRIMARY KEY CLUSTERED 
(
	[InstallSystemCode] ASC,
	[BusinessUnitCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINBranchPlantConstants] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINCostLedger]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINCostLedger]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINCostLedger](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[LotGrade] [char](3) NOT NULL,
	[CostMethodCode] [char](2) NOT NULL,
	[UnitCost] [decimal](20, 7) NOT NULL,
	[PurchasingCostingSelection] [char](1) NOT NULL,
	[InventoryCostingSelection] [char](1) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[CostChangedFlag] [char](2) NOT NULL,
	[CarryingCost] [int] NOT NULL,
	[OverstockCost] [int] NOT NULL,
	[StockoutCost] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINCostLedger] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[Location] ASC,
	[LotNumber] ASC,
	[CostMethodCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINCostLedger] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINItemBranch]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemBranch]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINItemBranch](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[SalesCategory01Code] [char](3) NOT NULL,
	[SalesCategory01] [char](30) NOT NULL,
	[SalesCategory02Code] [char](3) NOT NULL,
	[SalesCategory02] [char](30) NOT NULL,
	[SalesCategory03Code] [char](3) NOT NULL,
	[SalesCategory03] [char](30) NOT NULL,
	[SalesCategory04Code] [char](3) NOT NULL,
	[SalesCategory04] [char](30) NOT NULL,
	[SalesCategory05Code] [char](3) NOT NULL,
	[SalesCategory05] [char](30) NOT NULL,
	[SalesCategory06Code] [char](6) NOT NULL,
	[SalesCategory06] [char](30) NOT NULL,
	[SalesCategory07Code] [char](6) NOT NULL,
	[SalesCategory07] [char](30) NOT NULL,
	[SalesCategory08Code] [char](6) NOT NULL,
	[SalesCategory08] [char](30) NOT NULL,
	[SalesCategory09Code] [char](6) NOT NULL,
	[SalesCategory09] [char](30) NOT NULL,
	[SalesCategory10Code] [char](6) NOT NULL,
	[SalesCategory10] [char](30) NOT NULL,
	[PurchasingCategory01Code] [char](3) NOT NULL,
	[PurchasingCategory01] [char](30) NOT NULL,
	[PurchasingCategory02Code] [char](3) NOT NULL,
	[PurchasingCategory02] [char](30) NOT NULL,
	[PurchasingCategory03Code] [char](3) NOT NULL,
	[PurchasingCategory03] [char](30) NOT NULL,
	[PurchasingCategory04Code] [char](3) NOT NULL,
	[PurchasingCategory04] [char](30) NOT NULL,
	[PurchasingCategory05Code] [char](3) NOT NULL,
	[PurchasingCategory05] [char](30) NOT NULL,
	[PurchasingCategory06Code] [char](6) NOT NULL,
	[PurchasingCategory06] [char](30) NOT NULL,
	[PurchasingCategory07Code] [char](6) NOT NULL,
	[PurchasingCategory07] [char](30) NOT NULL,
	[PurchasingCategory08Code] [char](6) NOT NULL,
	[PurchasingCategory08] [char](30) NOT NULL,
	[PurchasingCategory09Code] [char](6) NOT NULL,
	[PurchasingCategory09] [char](30) NOT NULL,
	[PurchasingCategory10Code] [char](6) NOT NULL,
	[PurchasingCategory10] [char](30) NOT NULL,
	[CommodityCode] [char](15) NOT NULL,
	[ProductGroupCode] [char](3) NOT NULL,
	[ProductGroup] [char](30) NOT NULL,
	[DispatchGroup] [char](3) NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[PlannerNumber] [int] NOT NULL,
	[BuyerNumber] [int] NOT NULL,
	[GLCategory] [char](4) NOT NULL,
	[CountryofOrigin] [char](3) NOT NULL,
	[ReorderPoint] [decimal](22, 7) NOT NULL,
	[ReorderQuantity] [decimal](22, 7) NOT NULL,
	[MaximumReorderQuantity] [decimal](22, 7) NOT NULL,
	[MinimumReorderQuantity] [decimal](22, 7) NOT NULL,
	[MultipleOrderQuantitySoPo] [int] NOT NULL,
	[ServiceLevel] [decimal](20, 7) NOT NULL,
	[SafetyStock] [decimal](22, 7) NOT NULL,
	[ShelfLifeDays] [int] NOT NULL,
	[CheckAvailability] [char](1) NOT NULL,
	[LayerCodeSource] [char](1) NOT NULL,
	[LotStatusCode] [char](1) NOT NULL,
	[PotencyControl] [char](1) NOT NULL,
	[GradeControl] [char](1) NOT NULL,
	[StandardPotency] [decimal](20, 7) NOT NULL,
	[FromPotency] [decimal](20, 7) NOT NULL,
	[ThruPotency] [decimal](20, 7) NOT NULL,
	[StandardGrade] [char](3) NOT NULL,
	[FromGrade] [char](3) NOT NULL,
	[ThruGrade] [char](3) NOT NULL,
	[ComponentType] [char](1) NOT NULL,
	[MarginMaintenance] [decimal](20, 7) NOT NULL,
	[ItemPriceGroupCode] [char](8) NOT NULL,
	[ItemPriceGroup] [char](30) NOT NULL,
	[BasketRepriceGroup] [char](8) NOT NULL,
	[OrderRepriceGroup] [char](8) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[ItemFlashMessage] [char](2) NOT NULL,
	[ABCCode1Sales] [char](1) NOT NULL,
	[ABCCode2Margin] [char](1) NOT NULL,
	[ABCCode3Investment] [char](1) NOT NULL,
	[ABCCodeOverrideIndicator] [char](1) NOT NULL,
	[ShippingCommodityClass] [char](3) NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[PreferredCarrierPurchasing] [int] NOT NULL,
	[ShippingConditionsCode] [char](3) NOT NULL,
	[StockingTypeCode] [char](1) NOT NULL,
	[StockingType] [char](30) NOT NULL,
	[LineType] [char](2) NOT NULL,
	[FIFOProcessing] [char](1) NOT NULL,
	[CycleCountCategory] [char](3) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[TypeWarranty] [char](8) NOT NULL,
	[SerialNumberRequired] [char](1) NOT NULL,
	[PercentMargin] [decimal](20, 7) NOT NULL,
	[CommissionCategory] [char](8) NOT NULL,
	[ApplyFreight] [char](1) NOT NULL,
	[Taxable] [char](1) NOT NULL,
	[SalesTaxable] [char](1) NOT NULL,
	[PlanningCode] [char](1) NOT NULL,
	[ItemDisplayCode] [char](1) NOT NULL,
	[NetChangeFlag] [char](1) NOT NULL,
	[UnitsPerContainer] [decimal](15, 0) NOT NULL,
	[RoundToWholeNumber] [char](1) NOT NULL,
	[ItemRevisionLevel] [char](3) NOT NULL,
	[LeadtimeLevel] [int] NOT NULL,
	[LeadtimeManufacturing] [int] NOT NULL,
	[LeadtimeCumulative] [int] NOT NULL,
	[OrderPolicyCode] [char](1) NOT NULL,
	[ValueOrderPolicy] [decimal](15, 0) NOT NULL,
	[AccountingCostQuantity] [decimal](22, 7) NOT NULL,
	[MFGLeadtimeQuantity] [decimal](22, 7) NOT NULL,
	[LeadtimePerUnit] [decimal](20, 7) NOT NULL,
	[PlanningFenceRule] [char](1) NOT NULL,
	[FixedVariableLeadtime] [char](1) NOT NULL,
	[IssueTypeCode] [char](1) NOT NULL,
	[ECONumber] [char](12) NOT NULL,
	[ECOReason] [char](2) NOT NULL,
	[EngineeringChangeDate] [datetime] NOT NULL,
	[PlanningFence] [int] NOT NULL,
	[FreezeFence] [int] NOT NULL,
	[MessageDisplayFence] [int] NOT NULL,
	[TimeFence] [int] NOT NULL,
	[ShipmentLeadtimeOffset] [int] NOT NULL,
	[MoveHours] [decimal](20, 7) NOT NULL,
	[QueueHours] [decimal](20, 7) NOT NULL,
	[StandardSetupHours] [decimal](20, 7) NOT NULL,
	[ShrinkFactor] [decimal](20, 7) NOT NULL,
	[ShrinkFactorMethod] [char](1) NOT NULL,
	[TimeBasis] [char](1) NOT NULL,
	[BatchQuantity] [decimal](22, 7) NOT NULL,
	[OrderWith] [char](1) NOT NULL,
	[ExpediteDamperDays] [int] NOT NULL,
	[DeferDamperDays] [int] NOT NULL,
	[MultipleOrderQuantityMRP] [decimal](22, 7) NOT NULL,
	[SafetyLeadtime] [int] NOT NULL,
	[MakeBuyCode] [char](1) NOT NULL,
	[DateFutureUse] [datetime] NOT NULL,
	[LowLevelCode] [int] NOT NULL,
	[CommitmentMethod] [char](1) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[TempFlashMessage] [char](2) NOT NULL,
	[SpecificCommitmentDays] [int] NOT NULL,
	[ReplenishmentHoursStandard] [decimal](20, 7) NOT NULL,
	[IssueandReceipt] [char](1) NOT NULL,
	[ActiveIngredientFlag] [char](1) NOT NULL,
	[BestBeforeDefaultDays] [int] NOT NULL,
	[CommitmentDateMethod] [char](1) NOT NULL,
	[LotExpiratonDateCalculationMet] [char](1) NOT NULL,
	[LotEffectiveDefaultDays] [int] NOT NULL,
	[MixDatesLotsYN] [char](1) NOT NULL,
	[PurchasingEffectiveDays] [int] NOT NULL,
	[SellByDefaultDays] [int] NOT NULL,
	[UserLotDate1DefaultDays] [int] NOT NULL,
	[UserLotDate2DefaultDays] [int] NOT NULL,
	[UserLotDate3DefaultDays] [int] NOT NULL,
	[UserLotDate4DefaultDays] [int] NOT NULL,
	[UserLotDate5DefaultDays] [int] NOT NULL,
	[CrossDockingFlag] [char](1) NOT NULL,
	[LotAuditFlag] [char](1) NOT NULL,
	[SpecialLotFormat] [char](1) NOT NULL,
	[RestrictWorkOrderLotAssignment] [char](1) NOT NULL,
	[LotNumberPreAssignment] [char](1) NOT NULL,
	[LotStatusCodeExpanded] [char](3) NOT NULL,
	[ConstraintsFlag] [char](1) NOT NULL,
	[PriorityOneAlertLevel] [int] NOT NULL,
	[PriorityTwoAlertLevel] [int] NOT NULL,
	[LeadtimeConversionFactor] [decimal](20, 7) NOT NULL,
	[AllowShippingofHeldLots] [char](1) NOT NULL,
	[OperationalThreshold] [decimal](20, 7) NOT NULL,
	[CumulativeThreshold] [decimal](20, 7) NOT NULL,
	[ThresholdUnitOfMeasure] [char](3) NOT NULL,
	[LeanManufacturingFlag] [char](1) NOT NULL,
	[LineCellIdentifier] [char](12) NOT NULL,
	[TotalProductCycleTime] [decimal](20, 7) NOT NULL,
	[KanbanItem] [char](1) NOT NULL,
	[DemandFlowEndItemFlag] [char](1) NOT NULL,
	[KanbanExplodeToLowerLevel] [char](1) NOT NULL,
	[SellableItem] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINItemBranch] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINItemBranch] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINItemLedger]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemLedger]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINItemLedger](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[NumberofLines] [int] NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[ParentLot] [char](30) NOT NULL,
	[StorageUnitNumber] [int] NOT NULL,
	[DetailSequenceNumber] [int] NOT NULL,
	[TransactionLineNumber] [decimal](20, 7) NOT NULL,
	[FromTo] [char](1) NOT NULL,
	[LotMasterCardex] [char](1) NOT NULL,
	[LotStatusCode] [char](1) NOT NULL,
	[LotPotency] [decimal](20, 7) NOT NULL,
	[LotGrade] [char](3) NOT NULL,
	[ParentItemNumber] [int] NOT NULL,
	[Branch] [char](12) NOT NULL,
	[ContractNumber] [char](12) NOT NULL,
	[ContractSupplement] [int] NOT NULL,
	[ContractBalancesUpdated] [char](1) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[PayItem] [char](3) NOT NULL,
	[JournalEntryLineNumber] [decimal](20, 7) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[GLCategory] [char](4) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[AsOfPostedCode] [char](1) NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[TransactionUOM] [char](2) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[Explanation] [char](30) NOT NULL,
	[TransactionReference] [char](8) NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[TransactionQuantity] [decimal](22, 7) NOT NULL,
	[UnitCost] [decimal](20, 7) NOT NULL,
	[ExtendedCostPrice] [decimal](20, 7) NOT NULL,
	[TerminalIdentification] [char](10) NOT NULL,
	[UniqueKeyIDInternal] [decimal](15, 0) NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[CreationDate] [datetime] NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[BusinessUnitAlt] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[SubledgerGL] [char](8) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[UnitofMeasureSecondary] [char](2) NOT NULL,
	[CommingledOtherOwner] [char](1) NOT NULL,
	[ReverseorVoidRV] [char](1) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[UnitsSecondaryQuantityOrdered] [decimal](22, 7) NOT NULL,
	[ValuationPeriodEndingDate] [datetime] NOT NULL,
	[HistoricalDateJulian] [datetime] NOT NULL,
	[AddressNumberShipTo] [int] NOT NULL,
	[SequenceNumberOperations] [decimal](20, 7) NOT NULL,
	[RelatedFromLineNumber] [decimal](20, 7) NOT NULL,
	[TransactionGroupNumber] [decimal](20, 7) NOT NULL,
	[LotStatusCodeExpanded] [char](3) NOT NULL,
	[FutureUseDate] [datetime] NOT NULL,
	[LotStatusReasonCode] [char](3) NOT NULL,
	[SupplierLotNumber] [char](30) NOT NULL,
	[LicensePlateNumber] [char](40) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINItemLedger] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[UserID] ASC,
	[CreationDate] ASC,
	[TimeOfDay] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINItemLedger] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINItemLocation]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemLocation]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINItemLocation](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[PrimaryLocation] [char](1) NOT NULL,
	[GLCategory] [char](4) NOT NULL,
	[LotStatusCode] [char](1) NOT NULL,
	[LastReceiptDate] [datetime] NOT NULL,
	[QuantityOnHand] [decimal](22, 7) NOT NULL,
	[QuantityOnBackorder] [decimal](22, 7) NOT NULL,
	[QuantityOnPurchaseOrder] [decimal](22, 7) NOT NULL,
	[QuantityOnWorkOrderReceipt] [decimal](22, 7) NOT NULL,
	[QuantityOnSOOther1] [decimal](22, 7) NOT NULL,
	[QuantityOnSOOther2] [decimal](22, 7) NOT NULL,
	[QuantityOnPOOther1] [decimal](22, 7) NOT NULL,
	[QuantityOnHardCommit] [decimal](22, 7) NOT NULL,
	[QuantityOnSoftCommit] [decimal](22, 7) NOT NULL,
	[QuantityOnFutureCommit] [decimal](22, 7) NOT NULL,
	[QuantityOnWorkOrderSoftCommit] [decimal](22, 7) NOT NULL,
	[QuantityOnWorkOrderHardCommit] [decimal](22, 7) NOT NULL,
	[QuantityInTransit] [decimal](22, 7) NOT NULL,
	[QuantityInInspection] [decimal](22, 7) NOT NULL,
	[QuantityOnLoanToManufacturing] [decimal](22, 7) NOT NULL,
	[QuantityInbound] [decimal](22, 7) NOT NULL,
	[QuantityOutbound] [decimal](22, 7) NOT NULL,
	[NextCountDate] [datetime] NOT NULL,
	[FutureUseQty1] [decimal](15, 0) NOT NULL,
	[FutureUseQty2] [decimal](15, 0) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[QuantityInOperation1] [decimal](22, 7) NOT NULL,
	[QuantityInOperation2] [decimal](22, 7) NOT NULL,
	[SecondaryQuantityHardCommitted] [decimal](22, 7) NOT NULL,
	[ProjectHardCommittedQtyPrimary] [decimal](22, 7) NOT NULL,
	[ProjectHardCommittedQtyinSecon] [decimal](22, 7) NOT NULL,
	[SecondaryQuantitySoftCommitted] [decimal](22, 7) NOT NULL,
	[SecondaryQuantityInboundWareh] [decimal](22, 7) NOT NULL,
	[SecondaryQuantityOutboundWare] [decimal](22, 7) NOT NULL,
	[QuantityonHandinSecondaryunits] [decimal](22, 7) NOT NULL,
	[SecondaryQuantityWorkOrderRcpt] [decimal](22, 7) NOT NULL,
	[QuantityonPurchaseOrderSecond] [decimal](22, 7) NOT NULL,
	[SecondaryQuantityWOHardCommit] [decimal](22, 7) NOT NULL,
	[SecondaryQuantityWOSoftCommit] [decimal](22, 7) NOT NULL,
	[CriticalHoldFlag] [char](1) NOT NULL,
	[WorkFlowPendingFlag] [char](1) NOT NULL,
	[ConfiguredStringID] [char](32) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINItemLocation] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[Location] ASC,
	[LotNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINItemLocation] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINItemMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINItemMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[SearchText] [char](30) NOT NULL,
	[SearchTextCompressed] [char](30) NOT NULL,
	[SalesCategory01Code] [char](3) NOT NULL,
	[SalesCategory01] [char](30) NOT NULL,
	[SalesCategory02Code] [char](3) NOT NULL,
	[SalesCategory02] [char](30) NOT NULL,
	[SalesCategory03Code] [char](3) NOT NULL,
	[SalesCategory03] [char](30) NOT NULL,
	[SalesCategory04Code] [char](3) NOT NULL,
	[SalesCategory04] [char](30) NOT NULL,
	[SalesCategory05Code] [char](3) NOT NULL,
	[SalesCategory05] [char](30) NOT NULL,
	[SalesCategory06Code] [char](6) NOT NULL,
	[SalesCategory06] [char](30) NOT NULL,
	[SalesCategory07Code] [char](6) NOT NULL,
	[SalesCategory07] [char](30) NOT NULL,
	[SalesCategory08Code] [char](6) NOT NULL,
	[SalesCategory08] [char](30) NOT NULL,
	[SalesCategory09Code] [char](6) NOT NULL,
	[SalesCategory09] [char](30) NOT NULL,
	[SalesCategory10Code] [char](6) NOT NULL,
	[SalesCategory10] [char](30) NOT NULL,
	[PurchasingCategory01Code] [char](3) NOT NULL,
	[PurchasingCategory01] [char](30) NOT NULL,
	[PurchasingCategory02Code] [char](3) NOT NULL,
	[PurchasingCategory02] [char](30) NOT NULL,
	[PurchasingCategory03Code] [char](3) NOT NULL,
	[PurchasingCategory03] [char](30) NOT NULL,
	[PurchasingCategory04Code] [char](3) NOT NULL,
	[PurchasingCategory04] [char](30) NOT NULL,
	[PurchasingCategory05Code] [char](3) NOT NULL,
	[PurchasingCategory05] [char](30) NOT NULL,
	[PurchasingCategory06Code] [char](6) NOT NULL,
	[PurchasingCategory06] [char](30) NOT NULL,
	[PurchasingCategory07Code] [char](6) NOT NULL,
	[PurchasingCategory07] [char](30) NOT NULL,
	[PurchasingCategory08Code] [char](6) NOT NULL,
	[PurchasingCategory08] [char](30) NOT NULL,
	[PurchasingCategory09Code] [char](6) NOT NULL,
	[PurchasingCategory09] [char](30) NOT NULL,
	[PurchasingCategory10Code] [char](6) NOT NULL,
	[PurchasingCategory10] [char](30) NOT NULL,
	[CommodityCode] [char](15) NOT NULL,
	[ProductGroupCode] [char](3) NOT NULL,
	[ProductGroup] [char](30) NOT NULL,
	[DispatchGroup] [char](3) NOT NULL,
	[ItemPriceGroupCode] [char](8) NOT NULL,
	[ItemPrice] [char](30) NOT NULL,
	[BasketRepriceGroup] [char](8) NOT NULL,
	[OrderRepriceGroup] [char](8) NOT NULL,
	[BuyerNumber] [int] NOT NULL,
	[DrawingNumber] [char](20) NOT NULL,
	[LastRevisionNumber] [char](2) NOT NULL,
	[DrawingSize] [char](1) NOT NULL,
	[VolumeCubicDimension] [decimal](20, 7) NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[PreferredCarrierPurchasing] [int] NOT NULL,
	[ShippingConditionsCode] [char](3) NOT NULL,
	[ShippingCommodityClass] [char](3) NOT NULL,
	[UnitOfMeasurePrimary] [char](2) NOT NULL,
	[UnitOfMeasureSecondary] [char](2) NOT NULL,
	[UnitOfMeasurePurchas] [char](2) NOT NULL,
	[UnitOfMeasurePricing] [char](2) NOT NULL,
	[UnitOfMeasureShipping] [char](2) NOT NULL,
	[UnitOfMeasureProduction] [char](2) NOT NULL,
	[UnitOfMeasureAllocation] [char](2) NOT NULL,
	[UnitOfMeasureWeight] [char](2) NOT NULL,
	[UOMVolume] [char](2) NOT NULL,
	[UOMStocking] [char](2) NOT NULL,
	[UOMVolumeOrWeightPSAU] [char](1) NOT NULL,
	[CycleCountCategory] [char](3) NOT NULL,
	[GLCategory] [char](4) NOT NULL,
	[SalesPriceLevel] [char](1) NOT NULL,
	[PurchasePriceLevel] [char](1) NOT NULL,
	[InventoryCostLevel] [char](1) NOT NULL,
	[GradePotencyPricing] [char](1) NOT NULL,
	[CheckAvailability] [char](1) NOT NULL,
	[BulkPackedFlag] [char](1) NOT NULL,
	[LayerCodeSource] [char](1) NOT NULL,
	[PotencyControl] [char](1) NOT NULL,
	[GradeControl] [char](1) NOT NULL,
	[StandardPotency] [decimal](20, 7) NOT NULL,
	[FromPotency] [decimal](20, 7) NOT NULL,
	[ThruPotency] [decimal](20, 7) NOT NULL,
	[StandardGrade] [char](3) NOT NULL,
	[FromGrade] [char](3) NOT NULL,
	[ThruGrade] [char](3) NOT NULL,
	[ComponentType] [char](1) NOT NULL,
	[StockingTypeCode] [char](1) NOT NULL,
	[StockingType] [char](30) NOT NULL,
	[LineType] [char](2) NOT NULL,
	[ContractItem] [char](1) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[ItemFlashMessage] [char](2) NOT NULL,
	[TempFlashMessage] [char](2) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[ABCCode1Sales] [char](1) NOT NULL,
	[ABCCode2Margin] [char](1) NOT NULL,
	[ABCCode3Investment] [char](1) NOT NULL,
	[ABCCodeOverrideIndicator] [char](1) NOT NULL,
	[TypeWarranty] [char](8) NOT NULL,
	[CommissionCategory] [char](8) NOT NULL,
	[SerialNumberRequired] [char](1) NOT NULL,
	[KitPricingMethod] [char](1) NOT NULL,
	[FIFOProcessing] [char](1) NOT NULL,
	[LotStatusCode] [char](1) NOT NULL,
	[ShelfLifeDays] [int] NOT NULL,
	[PlannerNumber] [int] NOT NULL,
	[PlanningCode] [char](1) NOT NULL,
	[PercentMargin] [decimal](20, 7) NOT NULL,
	[MarginMaintenance] [decimal](20, 7) NOT NULL,
	[PartStatusCode] [char](2) NOT NULL,
	[RoundToWholeNumber] [char](1) NOT NULL,
	[LeadtimeLevel] [int] NOT NULL,
	[LeadtimeManufacturing] [int] NOT NULL,
	[LeadtimeCumulative] [int] NOT NULL,
	[OrderPolicyCode] [char](1) NOT NULL,
	[ValueOrderPolicy] [decimal](15, 0) NOT NULL,
	[AccountingCostQuantity] [decimal](22, 7) NOT NULL,
	[MFGLeadtimeQuantity] [decimal](22, 7) NOT NULL,
	[LeadtimePerUnit] [decimal](20, 7) NOT NULL,
	[PlanningFenceRule] [char](1) NOT NULL,
	[FixedVariableLeadtime] [char](1) NOT NULL,
	[IssueTypeCode] [char](1) NOT NULL,
	[OrderWith] [char](1) NOT NULL,
	[PlanningFence] [int] NOT NULL,
	[FreezeFence] [int] NOT NULL,
	[MessageDisplayFence] [int] NOT NULL,
	[TimeFence] [int] NOT NULL,
	[ShipmentLeadtimeOffset] [int] NOT NULL,
	[ExpediteDamperDays] [int] NOT NULL,
	[DeferDamperDays] [int] NOT NULL,
	[SafetyLeadtime] [int] NOT NULL,
	[MakeBuyCode] [char](1) NOT NULL,
	[CoProductByProductIntermediate] [char](1) NOT NULL,
	[LowLevelCode] [int] NOT NULL,
	[CommitmentMethod] [char](1) NOT NULL,
	[SpecificCommitmentDays] [int] NOT NULL,
	[ConfiguredStringIDNextNumber] [int] NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[UPCNumber] [char](13) NOT NULL,
	[AggregateSCCCodePI0] [char](14) NOT NULL,
	[UnitofMeasureUPC] [char](2) NOT NULL,
	[UnitofMeasureAggregateUPC] [char](2) NOT NULL,
	[UnitofMeasureSCCPI0] [char](2) NOT NULL,
	[UnitofMeasureSCCPI1] [char](2) NOT NULL,
	[UnitofMeasureSCCPI2] [char](2) NOT NULL,
	[UnitofMeasureSCCPI3] [char](2) NOT NULL,
	[UnitofMeasureSCCPI4] [char](2) NOT NULL,
	[UnitofMeasureSCCPI5] [char](2) NOT NULL,
	[UnitofMeasureSCCPI6] [char](2) NOT NULL,
	[UnitofMeasureSCCPI7] [char](2) NOT NULL,
	[UnitofMeasureSCCPI8] [char](2) NOT NULL,
	[IssueandReceipt] [char](1) NOT NULL,
	[ReplenishmentHoursStandard] [decimal](20, 7) NOT NULL,
	[ContainerCode] [char](5) NOT NULL,
	[ItemWeightRequiredYN] [char](1) NOT NULL,
	[Template] [char](20) NOT NULL,
	[Segment1] [char](10) NOT NULL,
	[Segment2] [char](10) NOT NULL,
	[Segment3] [char](10) NOT NULL,
	[Segment4] [char](10) NOT NULL,
	[Segment5] [char](10) NOT NULL,
	[Segment6] [char](10) NOT NULL,
	[Segment7] [char](10) NOT NULL,
	[Segment8] [char](10) NOT NULL,
	[Segment9] [char](10) NOT NULL,
	[Segment10] [char](10) NOT NULL,
	[MatrixControlled] [char](1) NOT NULL,
	[ActiveIngredientFlag] [char](1) NOT NULL,
	[BestBeforeDefaultDays] [int] NOT NULL,
	[CommitmentDateMethod] [char](1) NOT NULL,
	[LotExpiratonDateCalculationMet] [char](1) NOT NULL,
	[LotEffectiveDefaultDays] [int] NOT NULL,
	[PurchasingEffectiveDays] [int] NOT NULL,
	[SellByDefaultDays] [int] NOT NULL,
	[UserLotDate1DefaultDays] [int] NOT NULL,
	[UserLotDate2DefaultDays] [int] NOT NULL,
	[UserLotDate3DefaultDays] [int] NOT NULL,
	[UserLotDate4DefaultDays] [int] NOT NULL,
	[UserLotDate5DefaultDays] [int] NOT NULL,
	[DualTolerance] [decimal](20, 7) NOT NULL,
	[DualPickingProcessOption] [char](1) NOT NULL,
	[DualUnitOfMeasureItem] [char](1) NOT NULL,
	[CrossDockingFlag] [char](1) NOT NULL,
	[LotAuditFlag] [char](1) NOT NULL,
	[SpecialLotFormat] [char](1) NOT NULL,
	[RestrictWorkOrderLotAssignment] [char](1) NOT NULL,
	[LotNumberPreAssignment] [char](1) NOT NULL,
	[LotStatusCodeExpanded] [char](3) NOT NULL,
	[ConstraintsFlag] [char](1) NOT NULL,
	[APSPlanningUOM] [char](9) NOT NULL,
	[Consumable] [char](1) NOT NULL,
	[Composition] [char](1) NOT NULL,
	[PriorityOneAlertLevel] [decimal](20, 7) NOT NULL,
	[PriorityTwoAlertLevel] [decimal](20, 7) NOT NULL,
	[AllowShippingofHeldLots] [char](1) NOT NULL,
	[VendorManagedInventory] [char](1) NOT NULL,
	[MethodConfiguratorCosting] [char](1) NOT NULL,
	[ExplodeItem10] [char](1) NOT NULL,
	[OperationalThreshold] [decimal](20, 7) NOT NULL,
	[CumulativeThreshold] [decimal](20, 7) NOT NULL,
	[ThresholdUnitOfMeasure] [char](3) NOT NULL,
	[LeanManufacturingFlag] [char](1) NOT NULL,
	[LineCellIdentifier] [char](12) NOT NULL,
	[TotalProductCycleTime] [decimal](20, 7) NOT NULL,
	[KanbanItem] [char](1) NOT NULL,
	[DemandFlowEndItemFlag] [char](1) NOT NULL,
	[KanbanExplodeToLowerLevel] [char](1) NOT NULL,
	[SellableItem] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINItemMaster] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINItemMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINLocationMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINLocationMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINLocationMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Location] [char](20) NOT NULL,
	[Aisle] [char](8) NOT NULL,
	[Bin] [char](8) NOT NULL,
	[LocationCode03] [char](4) NOT NULL,
	[LocationCode04] [char](4) NOT NULL,
	[LocationCode05] [char](4) NOT NULL,
	[LocationCode06] [char](4) NOT NULL,
	[LocationCode07] [char](4) NOT NULL,
	[LocationCode08] [char](4) NOT NULL,
	[LocationCode09] [char](4) NOT NULL,
	[LocationCode10] [char](4) NOT NULL,
	[LevelOfDetail] [char](1) NOT NULL,
	[LocationDimensionGroup] [char](6) NOT NULL,
	[LocationCharacteristicsGroup] [char](6) NOT NULL,
	[LocationHoldCode] [char](2) NOT NULL,
	[FreezeRule] [char](1) NOT NULL,
	[NettableAllocatableCode] [char](1) NOT NULL,
	[MinimumPutawayPercent] [int] NOT NULL,
	[MinimumPickPercent] [int] NOT NULL,
	[LocalTaxCode] [char](2) NOT NULL,
	[MoveMethodCode] [char](4) NOT NULL,
	[ContainerTypeCode] [char](5) NOT NULL,
	[RecommendCarton] [char](1) NOT NULL,
	[MixContainers] [char](1) NOT NULL,
	[MixDatesLots] [char](1) NOT NULL,
	[MaximumNumberOfLots] [int] NOT NULL,
	[StagingLocation] [char](1) NOT NULL,
	[VerificationCode] [char](5) NOT NULL,
	[StorageConfirmation] [char](1) NOT NULL,
	[RetrievalConfirmation] [char](1) NOT NULL,
	[AllowPutaway] [char](1) NOT NULL,
	[AllowPick] [char](1) NOT NULL,
	[AllowReplenishment] [char](1) NOT NULL,
	[PutawayZone] [char](6) NOT NULL,
	[PickZone] [char](6) NOT NULL,
	[ReplenishmentZone] [char](6) NOT NULL,
	[PutawayStagingLocation] [char](20) NOT NULL,
	[PickingStagingLocation] [char](20) NOT NULL,
	[ReplenishmentStagingLocation] [char](20) NOT NULL,
	[PutawaySequence] [int] NOT NULL,
	[PickSequence] [int] NOT NULL,
	[ReplenishmentSequence] [int] NOT NULL,
	[DistanceLatitude] [int] NOT NULL,
	[DistanceLongitude] [int] NOT NULL,
	[Height] [int] NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[PotencyControl] [char](1) NOT NULL,
	[GradeControl] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[EquipmentType] [char](3) NOT NULL,
	[MixItemLot] [char](1) NOT NULL,
	[MergePartials] [char](1) NOT NULL,
	[MergeUnitofMeasureStructures] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINLocationMaster] PRIMARY KEY CLUSTERED 
(
	[BusinessUnitCode] ASC,
	[Location] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINLocationMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINLotMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINLotMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINLotMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[LotDescription] [char](30) NOT NULL,
	[LotStatusCode] [char](1) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[SupplierLot] [char](30) NOT NULL,
	[LotPotency] [decimal](15, 3) NOT NULL,
	[LotGrade] [char](3) NOT NULL,
	[LotExpirationDate] [datetime] NOT NULL,
	[LotSerialNumber] [char](30) NOT NULL,
	[UserDefinedDate01] [datetime] NOT NULL,
	[UserDefinedDate02] [datetime] NOT NULL,
	[UserDefinedDate03] [datetime] NOT NULL,
	[UserDefinedDate04] [datetime] NOT NULL,
	[UserDefinedDate05] [datetime] NOT NULL,
	[UserDefinedDate06] [datetime] NOT NULL,
	[UserDefinedQuantity01] [decimal](22, 7) NOT NULL,
	[UserDefinedQuantity02] [decimal](22, 7) NOT NULL,
	[UserDefinedQuantity03] [decimal](22, 7) NOT NULL,
	[UserDefinedQuantity04] [decimal](22, 7) NOT NULL,
	[UserDefinedQuantity05] [decimal](22, 7) NOT NULL,
	[UserDefinedQuantity06] [decimal](22, 7) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[LotCategory01Code] [char](3) NOT NULL,
	[LotCategory01] [char](30) NOT NULL,
	[LotCategory02Code] [char](3) NOT NULL,
	[LotCategory02] [char](30) NOT NULL,
	[LotCategory03Code] [char](3) NOT NULL,
	[LotCategory03] [char](30) NOT NULL,
	[LotCategory04Code] [char](3) NOT NULL,
	[LotCategory04] [char](30) NOT NULL,
	[LotCategory05Code] [char](3) NOT NULL,
	[LotCategory05] [char](30) NOT NULL,
	[LotCategory06Code] [char](3) NOT NULL,
	[LotCategory06] [char](30) NOT NULL,
	[LotCategory07Code] [char](3) NOT NULL,
	[LotCategory07] [char](30) NOT NULL,
	[LotCategory08Code] [char](3) NOT NULL,
	[LotCategory08] [char](30) NOT NULL,
	[LotCategory09Code] [char](3) NOT NULL,
	[LotCategory09] [char](30) NOT NULL,
	[LotCategory10Code] [char](3) NOT NULL,
	[LotCategory10] [char](30) NOT NULL,
	[MemoLot01] [char](30) NOT NULL,
	[MemoLot02] [char](30) NOT NULL,
	[MemoLot03] [char](30) NOT NULL,
	[BestBeforeDate] [datetime] NOT NULL,
	[BasedOnDate] [datetime] NOT NULL,
	[LotEffectivityDate] [datetime] NOT NULL,
	[OnHandDate] [datetime] NOT NULL,
	[SellByDate] [datetime] NOT NULL,
	[UserLotDate1] [datetime] NOT NULL,
	[UserLotDate2] [datetime] NOT NULL,
	[UserLotDate3] [datetime] NOT NULL,
	[UserLotDate4] [datetime] NOT NULL,
	[UserLotDate5] [datetime] NOT NULL,
	[CriticalHoldFlag] [char](1) NOT NULL,
	[WorkFlowPendingFlag] [char](1) NOT NULL,
	[DocumentOrder#Invoiceetc] [int] NOT NULL,
	[LotReusable] [char](1) NOT NULL,
	[LotStatusCodeExpanded] [char](3) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINLotMaster] PRIMARY KEY CLUSTERED 
(
	[LotNumber] ASC,
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINLotMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINOrderGroupKeyIDMaster]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINOrderGroupKeyIDMaster]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINOrderGroupKeyIDMaster](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderDetailGroup] [char](8) NOT NULL,
	[SalesDetailValue01] [char](12) NOT NULL,
	[SalesDetailValue02] [char](12) NOT NULL,
	[SalesDetailValue03] [char](12) NOT NULL,
	[SalesDetailValue04] [char](12) NOT NULL,
	[SalesDetailValue05] [char](12) NOT NULL,
	[SalesDetailValue06] [char](12) NOT NULL,
	[SalesDetailValue07] [char](12) NOT NULL,
	[SalesDetailValue08] [char](12) NOT NULL,
	[OrderGroupKeyID] [bigint] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINOrderGroupKeyIDMaster] PRIMARY KEY CLUSTERED 
(
	[OrderDetailGroup] ASC,
	[SalesDetailValue01] ASC,
	[SalesDetailValue02] ASC,
	[SalesDetailValue03] ASC,
	[SalesDetailValue04] ASC,
	[SalesDetailValue05] ASC,
	[SalesDetailValue06] ASC,
	[SalesDetailValue07] ASC,
	[SalesDetailValue08] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINOrderGroupKeyIDMaster] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINPriceAdjustmentHistory]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINPriceAdjustmentHistory]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINPriceAdjustmentHistory](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[SequenceNumber] [int] NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[AdjustmentName] [char](8) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ItemCustomerKeyID] [int] NOT NULL,
	[OrderDetailGroup] [char](8) NOT NULL,
	[SalesDetailValue01] [char](12) NOT NULL,
	[SalesDetailValue02] [char](12) NOT NULL,
	[SalesDetailValue03] [char](8) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[QuantityFrom] [decimal](15, 0) NOT NULL,
	[CostMethodCode] [char](2) NOT NULL,
	[FormulaName] [char](10) NOT NULL,
	[Basis] [char](1) NOT NULL,
	[FactorValue] [decimal](20, 7) NOT NULL,
	[OverridePriceYN] [char](1) NOT NULL,
	[UnitPrice] [decimal](20, 7) NOT NULL,
	[ForeignUnitPrice] [decimal](20, 7) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[AdjustmentControlCode] [char](1) NOT NULL,
	[SubledgerInGL] [char](1) NOT NULL,
	[ManualAddChangeYN] [char](1) NOT NULL,
	[PriceOverrideCode] [char](1) NOT NULL,
	[PriceAdjustmentKeyID] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[OrderSuffix] [char](6) NOT NULL,
	[PriceHistoryAlternateKey] [int] NOT NULL,
	[PriceHistoryAlternateKeySource] [char](4) NOT NULL,
	[SubSequenceNumber] [int] NOT NULL,
	[Tier] [int] NOT NULL,
	[ItemGroupKeyID] [int] NOT NULL,
	[CustomerGroupKeyID] [int] NOT NULL,
	[OrderGroupKeyID] [int] NOT NULL,
	[AddressNumberPriceAdjustments] [int] NOT NULL,
	[BasedonValue] [int] NOT NULL,
	[SlidingRateFlag] [char](2) NOT NULL,
	[AdjustmentCalculation] [char](160) NOT NULL,
	[NumberofOrders] [int] NOT NULL,
	[UnitofMeasureVolumeIncentives] [char](4) NOT NULL,
	[AdjustmentLevel] [char](2) NOT NULL,
	[AdjustmentStatus] [char](2) NOT NULL,
	[ChargeReference] [char](30) NOT NULL,
	[AccumulateatAddress] [int] NOT NULL,
	[BeneficiaryAddress] [int] NOT NULL,
	[MutuallyExclusiveAdjustmentGrp] [char](20) NOT NULL,
	[MutuallyExclusiveAdjustment] [char](2) NOT NULL,
	[FactorValueUnitofMeasure] [char](4) NOT NULL,
	[PromotionDisplayControl] [char](2) NOT NULL,
	[ConfigurationIDNumber] [int] NOT NULL,
	[ComponentIDNumber] [int] NOT NULL,
	[PricingReportingCode1] [char](6) NOT NULL,
	[PricingReportingCode2] [char](6) NOT NULL,
	[PricingReportingCode3] [char](6) NOT NULL,
	[PricingReportingCode4] [char](12) NOT NULL,
	[PricingReportingCode5] [char](12) NOT NULL,
	[PricingReportingCode6] [char](12) NOT NULL,
	[NetDownPrice] [char](2) NOT NULL,
	[PromotionID] [char](24) NOT NULL,
	[RoundingRuleName] [char](20) NOT NULL,
	[TargetApplication] [char](2) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[AdjustQuantityToPay] [char](1) NOT NULL,
	[QuantityToPay] [int] NOT NULL,
	[NewBasePriceFlag] [char](1) NOT NULL,
	[TestResultName] [char](30) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINPriceAdjustmentHistory] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderNumberDocumentCompany] ASC,
	[LineNumber] ASC,
	[SequenceNumber] ASC,
	[OrderSuffix] ASC,
	[PriceHistoryAlternateKey] ASC,
	[PriceHistoryAlternateKeySource] ASC,
	[SubSequenceNumber] ASC,
	[Tier] ASC,
	[TargetApplication] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINPriceAdjustmentHistory] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINUOMConversionFactors]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINUOMConversionFactors]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINUOMConversionFactors](
	[SOURCE] [char](20) NOT NULL,
	[SourceID] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[RelatedUnitOfMeasure] [char](2) NOT NULL,
	[UnitOfMeasureStructure] [char](1) NOT NULL,
	[ConversionFactor] [decimal](20, 7) NOT NULL,
	[ConvFactorSecondaryToPrimary] [decimal](20, 7) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[ExcludefromPO] [char](2) NOT NULL,
	[ExcludefromSO] [char](2) NOT NULL,
	[CodePurchasePriceCode] [decimal](20, 7) NOT NULL,
	[CodeSalesPriceCode] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINUOMConversionFactors] PRIMARY KEY CLUSTERED 
(
	[BusinessUnitCode] ASC,
	[ItemNumber] ASC,
	[UnitOfMeasure] ASC,
	[RelatedUnitOfMeasure] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEINUOMConversionFactors] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEINUOMstandardConversion]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEINUOMstandardConversion]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEINUOMstandardConversion](
	[SourceID] [int] NOT NULL,
	[Source] [nchar](20) NOT NULL,
	[UnitOfMeasure] [nchar](2) NOT NULL,
	[RelatedUnitOfMeasure] [nchar](2) NOT NULL,
	[ConversionFactor] [decimal](20, 7) NOT NULL,
	[UserID] [nchar](10) NOT NULL,
	[ProgramID] [nchar](10) NOT NULL,
	[WorkStationID] [nchar](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[ExcludefromPO] [nchar](2) NOT NULL,
	[ExcludefromSO] [nchar](2) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEINUOMStandardConversion] PRIMARY KEY CLUSTERED 
(
	[UnitOfMeasure] ASC,
	[RelatedUnitOfMeasure] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[JDEINUOMstandardConversion] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEMPForecastFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEMPForecastFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEMPForecastFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[ExtendedPrice] [decimal](20, 7) NOT NULL,
	[AmountForecast] [decimal](20, 7) NOT NULL,
	[QuantityForecast] [decimal](22, 7) NOT NULL,
	[ForecastType] [char](2) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[BypassForcingYN] [char](1) NOT NULL,
	[RevisedFlag] [char](1) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[YearCalendarYear] [int] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEMPForecastFile] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[RequestedDate] ASC,
	[AddressNumber] ASC,
	[ForecastType] ASC,
	[YearCalendarYear] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEMPForecastFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEMPLowerLevelRequirement]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEMPLowerLevelRequirement]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEMPLowerLevelRequirement](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[LeadtimeOffsetDays] [int] NOT NULL,
	[ParentItemNumber] [int] NOT NULL,
	[Branch] [char](12) NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[RelatedPOSOLineNumber] [decimal](20, 7) NOT NULL,
	[UniqueKeyIDInternal] [decimal](15, 0) NOT NULL,
	[PeggingRecordLinkInternal] [decimal](15, 0) NOT NULL,
	[ProjectNumber] [int] NOT NULL,
	[SourceDemandforReplenishment] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEMPLowerLevelRequirementsFile] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEMPLowerLevelRequirement] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEMPMessageFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEMPMessageFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEMPMessageFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[UniqueKeyIDInternal] [decimal](15, 0) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Branch] [char](12) NOT NULL,
	[MessageType] [char](1) NOT NULL,
	[MessageClearedYN] [char](1) NOT NULL,
	[HoldCode] [char](1) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[TransactionQuantity] [decimal](22, 7) NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[DateStartJulian] [datetime] NOT NULL,
	[DateRecommendedStartJulian] [datetime] NOT NULL,
	[DateRecommendedComplete] [datetime] NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[RecommendedEffectiveDate] [datetime] NOT NULL,
	[OriginalEffectiveDate] [datetime] NOT NULL,
	[LineCellIdentifier] [char](12) NOT NULL,
	[ProjectNumber] [int] NOT NULL,
	[SourceDemandforReplenishment] [int] NOT NULL,
	[OverrideStockingType] [char](1) NOT NULL,
	[LotSerialNumber] [char](30) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEMPMessageFile] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEMPMessageFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEMPSummaryFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEMPSummaryFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEMPSummaryFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[QuantityType] [char](2) NOT NULL,
	[DateStartJulian] [datetime] NOT NULL,
	[TransactionQuantity] [decimal](22, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEMPSummaryFile] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[QuantityType] ASC,
	[DateStartJulian] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEMPSummaryFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEOWARAdjustments]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARAdjustments]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEOWARAdjustments](
	[Source] [char](20) NOT NULL,
	[SourceID] [int] NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[PayItem] [char](3) NOT NULL,
	[PayItemExtensionNumber] [int] NOT NULL,
	[OriginalDocumentNumber] [int] NOT NULL,
	[OriginalDocumentType] [char](2) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalPayItem] [char](3) NOT NULL,
	[AdjustmentReasonCode] [char](3) NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[Century] [int] NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[InvoiceDate] [datetime] NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchType] [char](2) NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[GLPostedCode] [char](1) NOT NULL,
	[PayStatus] [char](1) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[GrossAmount] [decimal](20, 7) NOT NULL,
	[OpenAmount] [decimal](20, 7) NOT NULL,
	[DiscountAvailable] [decimal](20, 7) NOT NULL,
	[DiscountTaken] [decimal](20, 7) NOT NULL,
	[TaxableAmount] [decimal](20, 7) NOT NULL,
	[NonTaxableAmount] [decimal](20, 7) NOT NULL,
	[TaxAmount] [decimal](20, 7) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[DomesticEntryWMultiCurrDistr] [char](1) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyAmount] [decimal](20, 7) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[ForeignDiscountAvailable] [decimal](20, 7) NOT NULL,
	[ForeignDiscountTaken] [decimal](20, 7) NOT NULL,
	[ForeignTaxableAmount] [decimal](20, 7) NOT NULL,
	[ForeignNonTaxableAmount] [decimal](20, 7) NOT NULL,
	[ForeignTaxAmount] [decimal](20, 7) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[ServiceDateTax] [datetime] NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[DueDate] [datetime] NOT NULL,
	[DiscountDueDate] [datetime] NOT NULL,
	[OriginalDateNetDue] [datetime] NOT NULL,
	[AmountOriginalGross] [decimal](20, 7) NOT NULL,
	[ARPosttoCashManagement] [char](1) NOT NULL,
	[BatchRunIDInternal] [int] NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[StatementPrintFlag] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[OriginatingSystem] [char](1) NOT NULL,
	[AmountToDistribute] [decimal](20, 7) NOT NULL,
	[AmountCurrencyToDistribute] [decimal](20, 7) NOT NULL,
	[NonRecoverableTaxAmount] [decimal](20, 7) NOT NULL,
	[ForeignNonRecoverableTax] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [JDEOWARAdjustments_PK] PRIMARY KEY CLUSTERED 
(
	[DocumentNumber] ASC,
	[DocumentType] ASC,
	[DocumentCompany] ASC,
	[PayItem] ASC,
	[PayItemExtensionNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEOWARAdjustments] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEOWARARDeductionActivity]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARARDeductionActivity]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEOWARARDeductionActivity](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[DeductionID] [decimal](15, 0) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[ActivityReasonCode] [char](2) NOT NULL,
	[AmountActivity] [decimal](20, 7) NOT NULL,
	[AmountForeignDeduction] [decimal](20, 7) NOT NULL,
	[ActivityAmountTransaction] [decimal](20, 7) NOT NULL,
	[DateActivity] [datetime] NOT NULL,
	[SourcePaymentID] [decimal](15, 0) NOT NULL,
	[SourceFileLineIdentifier] [int] NOT NULL,
	[FileLineIdentifier50Second] [int] NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[TransactionCurrencyCode] [char](3) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[VoidReasonCode] [char](3) NOT NULL,
	[ReceiptNSFVoidCode] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEOWARARDeductionActivity] PRIMARY KEY CLUSTERED 
(
	[DeductionID] ASC,
	[LineNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEOWARARDeductionActivity] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEOWARARDeductionManagement]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARARDeductionManagement]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEOWARARDeductionManagement](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[DeductionID] [decimal](15, 0) NOT NULL,
	[DeductionType] [char](2) NOT NULL,
	[DeductionStatusCode] [char](2) NOT NULL,
	[AmountOpenDeduction] [decimal](20, 7) NOT NULL,
	[AmountDeduction] [decimal](20, 7) NOT NULL,
	[AmountForeignOpenDeduction] [decimal](20, 7) NOT NULL,
	[AmountForeignDeduction] [decimal](20, 7) NOT NULL,
	[DeductionOpenAmountTransaction] [decimal](20, 7) NOT NULL,
	[TransactionDeductionAmount] [decimal](20, 7) NOT NULL,
	[DeductionReasonCode] [char](2) NOT NULL,
	[DateDeductionOpened] [datetime] NOT NULL,
	[DateDeductionTickler] [datetime] NOT NULL,
	[DeductionManager] [int] NOT NULL,
	[OriginalDocumentNumber] [int] NOT NULL,
	[OriginalDocumentType] [char](2) NOT NULL,
	[OriginalPayItem] [char](3) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[ClaimDocumentNumber] [int] NOT NULL,
	[ClaimDocumentType] [char](2) NOT NULL,
	[ClaimDocumentPayItem] [char](3) NOT NULL,
	[ClaimDocumentCompany] [char](5) NOT NULL,
	[InternalPaymentID] [decimal](15, 0) NOT NULL,
	[FileLineIdentifier] [int] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[TransactionCurrencyCode] [char](3) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[ReceiptNSFVoidCode] [char](1) NOT NULL,
	[VoidReasonCode] [char](3) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[ShipmentNumber] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEOWARARDeductionManagement] PRIMARY KEY CLUSTERED 
(
	[DeductionID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEOWARARDeductionManagement] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEOWARCheckDetail]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARCheckDetail]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEOWARCheckDetail](
	[Source] [char](20) NOT NULL,
	[SourceID] [int] NOT NULL,
	[InternalPaymentID] [decimal](15, 0) NOT NULL,
	[FileLineIdentifier] [int] NOT NULL,
	[ReceiptNumber] [char](25) NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[PayItem] [char](3) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PaymentItemDocumentType] [char](2) NOT NULL,
	[CheckItemDate] [datetime] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[GLPostedCode] [char](1) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[Century] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[BatchType] [char](2) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[RelatedPaymentID] [decimal](15, 0) NOT NULL,
	[RelatedPaymentLineID] [int] NOT NULL,
	[PaymentAmount] [decimal](20, 7) NOT NULL,
	[DiscountAvailable] [decimal](20, 7) NOT NULL,
	[DiscountTaken] [decimal](20, 7) NOT NULL,
	[AmountWriteOff] [decimal](20, 7) NOT NULL,
	[AmountChargeback] [decimal](20, 7) NOT NULL,
	[AmountDeduction] [decimal](20, 7) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[PaymentAmountForeign] [decimal](20, 7) NOT NULL,
	[ForeignDiscountAvailable] [decimal](20, 7) NOT NULL,
	[ForeignDiscountTaken] [decimal](20, 7) NOT NULL,
	[ForeignChangedAmount] [decimal](20, 7) NOT NULL,
	[AmountForeignchargeback] [decimal](20, 7) NOT NULL,
	[AmountForeignDeduction] [decimal](20, 7) NOT NULL,
	[AmountGainLoss] [decimal](20, 7) NOT NULL,
	[DiscountAccountID] [char](8) NOT NULL,
	[WriteOffReasonCode] [char](2) NOT NULL,
	[WriteOffAccountID] [char](8) NOT NULL,
	[ChargebackReasonCode] [char](2) NOT NULL,
	[GLOffsetchargebacks] [char](4) NOT NULL,
	[ChargebackAccountID] [char](8) NOT NULL,
	[DeductionReasonCode] [char](2) NOT NULL,
	[DeductionAccountID] [char](8) NOT NULL,
	[ReceiptTypeCode] [char](1) NOT NULL,
	[UserTypeInputCode] [char](2) NOT NULL,
	[UnappliedCashTransfer] [char](1) NOT NULL,
	[GLCreditAccountID] [char](8) NOT NULL,
	[AccountMode02] [char](1) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[PurchaseOrderDocumentCompany] [char](5) NOT NULL,
	[PONumber] [char](8) NOT NULL,
	[PurchaseOrderDocumentType] [char](2) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[UnitNumber] [char](8) NOT NULL,
	[AssetBusinessUnit] [char](12) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[ClosedStatement] [char](1) NOT NULL,
	[CashBasisAccountingPostCode] [char](1) NOT NULL,
	[OriginalDocumentNumber] [int] NOT NULL,
	[OriginalDocumentType] [char](2) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalPayItem] [char](3) NOT NULL,
	[ClaimDocumentNumber] [int] NOT NULL,
	[ClaimDocumentType] [char](2) NOT NULL,
	[ClaimDocumentCompany] [char](5) NOT NULL,
	[ClaimDocumentPayItem] [char](3) NOT NULL,
	[DocumentTypeJE] [char](2) NOT NULL,
	[DocumentNumberJE] [int] NOT NULL,
	[DocumentCompanyJE] [char](5) NOT NULL,
	[StatementNumber] [char](13) NOT NULL,
	[StatementDate] [datetime] NOT NULL,
	[GLVoidDate] [datetime] NOT NULL,
	[VoidReasonCode] [char](3) NOT NULL,
	[ReceiptNSFVoidCode] [char](1) NOT NULL,
	[HistoricalExchangeRate] [decimal](20, 7) NOT NULL,
	[ARPosttoCashManagement] [char](1) NOT NULL,
	[DateLastFeeCalculatedJulian] [datetime] NOT NULL,
	[PartialPayment] [char](1) NOT NULL,
	[DueDate] [datetime] NOT NULL,
	[DiscountDueDate] [datetime] NOT NULL,
	[DateInvoiceJournalDateJulian] [datetime] NOT NULL,
	[DraftStatus] [char](1) NOT NULL,
	[BatchRunIDInternal] [int] NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[TransactionchargeBackAmount] [decimal](20, 7) NOT NULL,
	[TransactionDeductionAmount] [decimal](20, 7) NOT NULL,
	[TransactionPaymentAmount] [decimal](20, 7) NOT NULL,
	[TransactionDiscountAmount] [decimal](20, 7) NOT NULL,
	[TransactionWriteoffAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedCode] [char](3) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[ShipmentNumber] [int] NOT NULL,
	[OriginatingSystem] [char](1) NOT NULL,
	[DocumentOrderNoInvoiceetc] [int] NOT NULL,
	[RoundingAccountShortID] [char](8) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[OrderCompanyOrderNumber] [char](5) NOT NULL,
	[OrderType] [char](2) NOT NULL,
	[RoundingAmount] [decimal](20, 7) NOT NULL,
	[LocalizationReservedFlag] [char](1) NOT NULL,
	[GenericFlag2] [char](1) NOT NULL,
	[DiscountReasonCode] [char](3) NOT NULL,
	[NettingTransactionID] [int] NOT NULL,
	[NettingDocumentNumber] [int] NOT NULL,
	[NettingLineID] [int] NOT NULL,
	[ActualReceiptDate] [datetime] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [JDEOWARCheckDetail_PK] PRIMARY KEY CLUSTERED 
(
	[InternalPaymentID] ASC,
	[FileLineIdentifier] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEOWARCheckDetail] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEOWARDeductionActivityMast]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARDeductionActivityMast]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEOWARDeductionActivityMast](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[DeductionActivityCode] [char](2) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[WriteOffReasonCode] [char](2) NOT NULL,
	[chargebackReasonCode] [char](2) NOT NULL,
	[ActivityTicklerDisplacement] [int] NOT NULL,
	[DeductionReversalCode] [char](1) NOT NULL,
	[DeductionDiscountCode] [char](1) NOT NULL,
	[CreditMemoActivityCode] [char](1) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[DiscountReasonCode] [char](3) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEOWARDeductionsActivityMaster] PRIMARY KEY CLUSTERED 
(
	[DeductionActivityCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEOWARDeductionActivityMast] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEOWARLedger]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARLedger]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEOWARLedger](
	[Source] [char](20) NOT NULL,
	[SourceID] [int] NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[PayItem] [char](3) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[InvoiceDate] [datetime] NOT NULL,
	[BatchType] [char](2) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[Century] [int] NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[AlternatePayeeAddressNumber] [int] NOT NULL,
	[PayorAddressNumber] [int] NOT NULL,
	[GLPostedCode] [char](1) NOT NULL,
	[ARPostStatus] [char](1) NOT NULL,
	[BalancedJE] [char](1) NOT NULL,
	[PayStatus] [char](1) NOT NULL,
	[GrossAmount] [decimal](20, 7) NOT NULL,
	[OpenAmount] [decimal](20, 7) NOT NULL,
	[DiscountAvailable] [decimal](20, 7) NOT NULL,
	[DiscountTaken] [decimal](20, 7) NOT NULL,
	[TaxableAmount] [decimal](20, 7) NOT NULL,
	[NonTaxableAmount] [decimal](20, 7) NOT NULL,
	[TaxAmount] [decimal](20, 7) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[DomesticEntryWMultiCurrDistr] [char](1) NOT NULL,
	[CurrencyAmount] [decimal](20, 7) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[ForeignDiscountAvailable] [decimal](20, 7) NOT NULL,
	[ForeignDiscountTaken] [decimal](20, 7) NOT NULL,
	[ForeignTaxableAmount] [decimal](20, 7) NOT NULL,
	[ForeignNonTaxableAmount] [decimal](20, 7) NOT NULL,
	[ForeignTaxAmount] [decimal](20, 7) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[ServiceDateTax] [datetime] NOT NULL,
	[GLBankAccount] [char](8) NOT NULL,
	[AccountMode01] [char](1) NOT NULL,
	[GLCreditAccountID] [char](8) NOT NULL,
	[AccountMode02] [char](1) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[DueDate] [datetime] NOT NULL,
	[DiscountDueDate] [datetime] NOT NULL,
	[DateOfLastSentReminder] [datetime] NOT NULL,
	[ReminderStopUntilDate] [datetime] NOT NULL,
	[DateLastFeeCalculatedJulian] [datetime] NOT NULL,
	[StatementDate] [datetime] NOT NULL,
	[NumberOfRemindersToSend] [char](1) NOT NULL,
	[LevelOfLastSentReminder] [char](1) NOT NULL,
	[TotalNumberOfSentReminders] [int] NOT NULL,
	[CollectionReport] [char](1) NOT NULL,
	[CollectionReasonCode] [char](2) NOT NULL,
	[ApplyFinancecharges] [char](1) NOT NULL,
	[DelinquencyNotice] [char](1) NOT NULL,
	[WriteOffReasonCode] [char](2) NOT NULL,
	[OriginalDocumentNumber] [int] NOT NULL,
	[OriginalDocumentType] [char](2) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalPayItem] [char](3) NOT NULL,
	[InvoiceNumber] [char](25) NOT NULL,
	[PONumber] [char](8) NOT NULL,
	[PurchaseOrderDocumentType] [char](2) NOT NULL,
	[PurchaseOrderDocumentCompany] [char](5) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[SalesDocumentNumber] [int] NOT NULL,
	[SalesDocumentType] [char](2) NOT NULL,
	[SalesOrderDocumentCompany] [char](5) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[ClearedValueDate] [datetime] NOT NULL,
	[CommissionCode01] [int] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[UnitNumber] [char](8) NOT NULL,
	[AssetBusinessUnit] [char](12) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[RecurFrequency] [char](2) NOT NULL,
	[NumberOfPayments] [int] NOT NULL,
	[StatementNumber] [char](13) NOT NULL,
	[ClosedStatement] [char](1) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[Units] [decimal](20, 7) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[CashBasisAccountingPostCode] [char](1) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[GLVoidDate] [datetime] NOT NULL,
	[VoidFlag] [char](1) NOT NULL,
	[MiscellaneousCode01] [char](1) NOT NULL,
	[MiscellaneousCode02] [char](1) NOT NULL,
	[CashRcptsInvRegCode] [char](1) NOT NULL,
	[ARReportingCode1] [char](3) NOT NULL,
	[ARReportingCode2] [char](3) NOT NULL,
	[ARReportingCode3] [char](3) NOT NULL,
	[ARReportingCode4] [char](3) NOT NULL,
	[ARReportingCode5] [char](3) NOT NULL,
	[ARReportingCode6] [char](3) NOT NULL,
	[ARReportingCode7] [char](3) NOT NULL,
	[ARReportingCode8] [char](3) NOT NULL,
	[ARReportingCode9] [char](3) NOT NULL,
	[ARReportingCode10] [char](3) NOT NULL,
	[ARPosttoCashManagement] [char](1) NOT NULL,
	[InternalPaymentID] [decimal](15, 0) NOT NULL,
	[UserReservedCode] [char](3) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[BatchRunIDInternal] [int] NOT NULL,
	[DateInvoicePrinted] [datetime] NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[DateInvoiceClosed] [datetime] NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[DeductionReasonCode] [char](2) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[HistoricalExchangeRate] [decimal](20, 7) NOT NULL,
	[HistoricalDate] [datetime] NOT NULL,
	[ShipmentNumber] [int] NOT NULL,
	[DeferredTaxStatusVAT] [char](1) NOT NULL,
	[OriginatingSystem] [char](1) NOT NULL,
	[CollectionManager] [char](10) NOT NULL,
	[CreditManager] [char](10) NOT NULL,
	[AmountToDistribute] [decimal](20, 7) NOT NULL,
	[AmountCurrencyToDistribute] [decimal](20, 7) NOT NULL,
	[NonRecoverableTaxAmount] [decimal](20, 7) NOT NULL,
	[ForeignNonRecoverableTax] [decimal](20, 7) NOT NULL,
	[PurgeFlag] [char](1) NOT NULL,
	[GenericFlag1] [char](1) NOT NULL,
	[GenericFlag2] [char](1) NOT NULL,
	[DocumentOrderNoInvoiceetc] [int] NOT NULL,
	[OrderCompanyOrderNumber] [char](5) NOT NULL,
	[SalesOrderTaxFlag] [char](1) NOT NULL,
	[NotificationPaymentDate] [datetime] NOT NULL,
	[DateForExchangeRateJulian] [datetime] NOT NULL,
	[PayWhenPaidGroupNumber] [int] NOT NULL,
	[NettingTransactionID] [int] NOT NULL,
	[NettingDocumentNumber] [int] NOT NULL,
	[NettingLineID] [int] NOT NULL,
	[NettingStatusCode] [char](1) NOT NULL,
	[ActualDateInvoiceClosed] [datetime] NOT NULL,
	[GenericARReceiptMatchingRef1] [char](50) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEOWARLedger] PRIMARY KEY CLUSTERED 
(
	[DocumentNumber] ASC,
	[DocumentType] ASC,
	[DocumentCompany] ASC,
	[PayItem] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEOWARLedger] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEOWARReceiptsHeaderFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARReceiptsHeaderFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEOWARReceiptsHeaderFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[InternalPaymentID] [decimal](15, 0) NOT NULL,
	[ReceiptNumber] [char](25) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PayorAddressNumber] [int] NOT NULL,
	[CheckItemDate] [datetime] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[ClearedValueDate] [datetime] NOT NULL,
	[GLPostedCode] [char](1) NOT NULL,
	[ARPostStatus] [char](1) NOT NULL,
	[ARPosttoCashManagement] [char](1) NOT NULL,
	[CashReceiptLoggedCash] [char](1) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[Century] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[BatchType] [char](2) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[AmountCheckAmount] [decimal](20, 7) NOT NULL,
	[OpenAmount] [decimal](20, 7) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[DateForExchangeRateJulian] [datetime] NOT NULL,
	[CurrencyConversionYZ] [char](1) NOT NULL,
	[TriangulationLeg1] [decimal](15, 7) NOT NULL,
	[TriangulationLeg2] [decimal](15, 7) NOT NULL,
	[ForeignReceiptAmount] [decimal](20, 7) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[GLBankAccount] [char](8) NOT NULL,
	[AccountMode01] [char](1) NOT NULL,
	[ReceiptTypeCode] [char](1) NOT NULL,
	[RemarkExplaination] [char](30) NOT NULL,
	[CashBasisAccountingPostCode] [char](1) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[BankTapeReconcilliationRef] [char](8) NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[DocumentNumberJE] [int] NOT NULL,
	[DocumentTypeJE] [char](2) NOT NULL,
	[DocumentCompanyJE] [char](5) NOT NULL,
	[GLVoidDate] [datetime] NOT NULL,
	[VoidReasonCode] [char](3) NOT NULL,
	[ReceiptNSFVoidCode] [char](1) NOT NULL,
	[DocumentNumberVoidNSFJE] [int] NOT NULL,
	[DocumentTypeVoidNSFJE] [char](2) NOT NULL,
	[DocumentCompanyVoidNSFJE] [char](5) NOT NULL,
	[VoidNSFBatchType] [char](2) NOT NULL,
	[VoidNSFBatchNumber] [int] NOT NULL,
	[VoidNSFBatchDate] [datetime] NOT NULL,
	[VoidNSFPostedCode] [char](1) NOT NULL,
	[CustomerBankAccountNumber] [char](20) NOT NULL,
	[BankTransitNumber] [char](20) NOT NULL,
	[CheckClearedDate] [datetime] NOT NULL,
	[AutoCash] [char](1) NOT NULL,
	[AutoReceiptApplyAllCurrencies] [char](1) NOT NULL,
	[Uploadedfromtapebatchentry] [char](1) NOT NULL,
	[Clerk] [char](10) NOT NULL,
	[AutoReceiptsExecutionList] [char](10) NOT NULL,
	[AutoReceiptAlgorithmSequence] [int] NOT NULL,
	[APAutoReceiptProcessAlgorithm] [char](10) NOT NULL,
	[VersionHistory] [char](10) NOT NULL,
	[AutoReceiptStatusFlag] [char](1) NOT NULL,
	[DraftStatus] [char](1) NOT NULL,
	[Reference] [char](25) NOT NULL,
	[RenewalReferenceField] [decimal](15, 0) NOT NULL,
	[CashDiscDraftFlag] [char](1) NOT NULL,
	[DraftRegister] [char](13) NOT NULL,
	[UserReservedCode] [char](3) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[GenericFlag1] [char](1) NOT NULL,
	[PurgeCode] [char](1) NOT NULL,
	[BatchRunIDInternal] [int] NOT NULL,
	[CurrentUserID] [char](10) NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[VoidFiscalYear] [int] NOT NULL,
	[VoidFiscalPeriod] [int] NOT NULL,
	[VoidFiscalCentury] [int] NOT NULL,
	[OriginatingSystem] [char](1) NOT NULL,
	[MulticurrIntercompanyPayment] [char](1) NOT NULL,
	[LocalizationReservedFlag] [char](1) NOT NULL,
	[GenericFlag2] [char](1) NOT NULL,
	[NettingTransactionID] [int] NOT NULL,
	[NettingDocumentNumber] [int] NOT NULL,
	[ReconciledCode] [char](1) NOT NULL,
	[Ref3AccountReconciliation] [char](8) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEOWARReceiptsHeaderFile] PRIMARY KEY CLUSTERED 
(
	[InternalPaymentID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEOWARReceiptsHeaderFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPDItemCostComponent]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPDItemCostComponent]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPDItemCostComponent](
	[SourceID] [int] NOT NULL,
	[Source] [nchar](20) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [nchar](25) NOT NULL,
	[ItemNumber03] [nchar](25) NOT NULL,
	[Branch] [nchar](12) NOT NULL,
	[Location] [nchar](20) NOT NULL,
	[LotNumber] [nchar](30) NOT NULL,
	[CostMethodCode] [nchar](2) NOT NULL,
	[CostType] [nchar](3) NOT NULL,
	[LotGrade] [nchar](3) NOT NULL,
	[ManufacturedCostFrozen] [decimal](20, 7) NOT NULL,
	[ManufacturedCostSimulated] [decimal](20, 7) NOT NULL,
	[CostRollupFrozen] [decimal](20, 7) NOT NULL,
	[CostRollupSimulated] [decimal](20, 7) NOT NULL,
	[FactorCodeFrozen] [nchar](4) NOT NULL,
	[FactorCodeSimulated] [nchar](4) NOT NULL,
	[FactorFrozen] [decimal](15, 4) NOT NULL,
	[FactorSimulated] [decimal](15, 4) NOT NULL,
	[RateCodeFrozen] [nchar](4) NOT NULL,
	[RateCodeSimulated] [nchar](4) NOT NULL,
	[RateFrozen] [decimal](20, 7) NOT NULL,
	[RateSimulated] [decimal](20, 7) NOT NULL,
	[ProcessingFlag] [nchar](1) NOT NULL,
	[UserID] [nchar](10) NOT NULL,
	[ProgramID] [nchar](10) NOT NULL,
	[WorkStationID] [nchar](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[SequenceNumberOperations] [decimal](20, 7) NOT NULL,
	[AlternateWorkCenter] [nchar](24) NOT NULL,
	[WorkcenterBranch] [nchar](24) NOT NULL,
	[AccountLevelofDetail] [nchar](2) NOT NULL,
	[TypeBillofMaterial] [nchar](6) NOT NULL,
	[QuantityAccountingCost] [int] NOT NULL,
	[DetailFlag] [nchar](2) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPDItemCostComponent] PRIMARY KEY CLUSTERED 
(
	[ItemNumber] ASC,
	[Branch] ASC,
	[Location] ASC,
	[LotNumber] ASC,
	[CostMethodCode] ASC,
	[CostType] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[JDEPDItemCostComponent] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPDRoutingMasterFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPDRoutingMasterFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPDRoutingMasterFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[TypeofRouting] [char](3) NOT NULL,
	[ParentItemNumber] [int] NOT NULL,
	[ItemNumber2ndKit] [char](25) NOT NULL,
	[ItemNumber3rdKit] [char](25) NOT NULL,
	[Branch] [char](12) NOT NULL,
	[AutoLoadDescription] [char](4) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[LineCellIdentifier] [char](12) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[OperationsSequenceNumber] [decimal](20, 7) NOT NULL,
	[EffectiveFromDate] [datetime] NOT NULL,
	[EffectiveThruDate] [datetime] NOT NULL,
	[PayPointCode] [char](1) NOT NULL,
	[LabororMachine] [char](1) NOT NULL,
	[TimeBasis] [char](1) NOT NULL,
	[FactorOperationShrinkageFactor] [decimal](20, 7) NOT NULL,
	[BatchQuantity] [decimal](20, 7) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[RunMachineStandard] [decimal](20, 7) NOT NULL,
	[RunLaborStandard] [decimal](20, 7) NOT NULL,
	[StandardSetupHours] [decimal](20, 7) NOT NULL,
	[RatePiecework] [decimal](20, 7) NOT NULL,
	[CrewSize] [decimal](20, 7) NOT NULL,
	[MoveHours] [decimal](20, 7) NOT NULL,
	[QueueHours] [decimal](20, 7) NOT NULL,
	[PercentLeadtimeOverlap] [decimal](20, 7) NOT NULL,
	[PercentOverlap] [decimal](20, 7) NOT NULL,
	[SequenceNumberNextOperation] [decimal](20, 7) NOT NULL,
	[PercentOperationalPlannedYield] [decimal](20, 7) NOT NULL,
	[PercentCumulativePlannedYield] [decimal](20, 7) NOT NULL,
	[UnitorTagNumber] [char](12) NOT NULL,
	[MessageNumber] [char](10) NOT NULL,
	[TypeOperationCode] [char](2) NOT NULL,
	[InspectionCode] [char](2) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[PurchaseOrderYN] [char](1) NOT NULL,
	[CostType] [char](3) NOT NULL,
	[PurchasingBusinessUnit] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[RoutingRevisionLevel] [char](3) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[ConstraintsFlag] [char](1) NOT NULL,
	[ActivityBasedCostingActyCode] [char](10) NOT NULL,
	[WorkcenterBranch] [char](12) NOT NULL,
	[CapacityUnitOfMeasure] [char](2) NOT NULL,
	[CoByCounter] [decimal](20, 7) NOT NULL,
	[ComponentIngredientCounter] [decimal](20, 7) NOT NULL,
	[CompetencyLevelFrom] [decimal](20, 7) NOT NULL,
	[CompetencyLevelTo] [decimal](20, 7) NOT NULL,
	[CompetencyCode] [char](10) NOT NULL,
	[CompetencyType] [char](3) NOT NULL,
	[RuleMatchFlag] [char](1) NOT NULL,
	[ResourceUnitsConsumed] [decimal](20, 7) NOT NULL,
	[IntermediateCounter] [decimal](20, 7) NOT NULL,
	[MinimumSeparation] [decimal](20, 7) NOT NULL,
	[MinimumProduction] [decimal](20, 7) NOT NULL,
	[MaximumSeparation] [decimal](20, 7) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[Location] [char](20) NOT NULL,
	[AddressNumberManager] [int] NOT NULL,
	[Supervisor] [int] NOT NULL,
	[AddressNumberAssignedTo] [int] NOT NULL,
	[MaintenanceScheduleFlag] [char](1) NOT NULL,
	[ResourcesAssigned] [char](1) NOT NULL,
	[DFMOperationOnCriticalPath] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPDRoutingMasterFile] PRIMARY KEY CLUSTERED 
(
	[TypeofRouting] ASC,
	[ParentItemNumber] ASC,
	[Branch] ASC,
	[OperationsSequenceNumber] ASC,
	[EffectiveFromDate] ASC,
	[BatchQuantity] ASC,
	[TypeOperationCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPDRoutingMasterFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPOPurchaseOrderDetail]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPOPurchaseOrderDetail]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPOPurchaseOrderDetail](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalOrderNumber] [char](8) NOT NULL,
	[OriginalOrderTypeCode] [char](2) NOT NULL,
	[OriginalLineNumber] [decimal](20, 7) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[RelatedPOSOLineNumber] [decimal](20, 7) NOT NULL,
	[ContractNumber] [char](12) NOT NULL,
	[ContractSupplement] [int] NOT NULL,
	[ContractBalancesUpdated] [char](1) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ShipTo] [int] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[PromisedDeliveryDate] [datetime] NOT NULL,
	[OriginalPromisedDate] [datetime] NOT NULL,
	[ActualDeliveryDate] [datetime] NOT NULL,
	[CancelDate] [datetime] NOT NULL,
	[PriceEffectiveDate] [datetime] NOT NULL,
	[ShipDate] [datetime] NOT NULL,
	[FutureUseDate] [datetime] NOT NULL,
	[ServiceDateTax] [datetime] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[Reference2] [char](25) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[FromGrade] [char](3) NOT NULL,
	[ThruGrade] [char](3) NOT NULL,
	[FromPotency] [decimal](20, 7) NOT NULL,
	[ThruPotency] [decimal](20, 7) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[LineType] [char](2) NOT NULL,
	[StatusCodeNext] [char](3) NOT NULL,
	[StatusCodeLast] [char](3) NOT NULL,
	[RelatedItemNumber] [char](8) NOT NULL,
	[SalesCategory01Code] [char](3) NOT NULL,
	[SalesCategory02Code] [char](3) NOT NULL,
	[SalesCategory03Code] [char](3) NOT NULL,
	[SalesCategory04Code] [char](3) NOT NULL,
	[SalesCategory05Code] [char](3) NOT NULL,
	[PurchasingCategory01Code] [char](3) NOT NULL,
	[PurchasingCategory02Code] [char](3) NOT NULL,
	[PurchasingCategory03Code] [char](3) NOT NULL,
	[PurchasingCategory04Code] [char](3) NOT NULL,
	[PurchasingCategory05Code] [char](3) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[ChangeOrderQuantity] [decimal](22, 7) NOT NULL,
	[QuantityOpen] [decimal](22, 7) NOT NULL,
	[ReceivedQuantity] [decimal](22, 7) NOT NULL,
	[QuantityCumulativeReceived] [decimal](22, 7) NOT NULL,
	[QuantityRelieved] [decimal](22, 7) NOT NULL,
	[OtherQuantity] [char](1) NOT NULL,
	[PurchasingUnitPrice] [decimal](20, 7) NOT NULL,
	[ExtendedPrice] [decimal](20, 7) NOT NULL,
	[ChangeAmount] [decimal](20, 7) NOT NULL,
	[AmountOpen] [decimal](20, 7) NOT NULL,
	[AmountReceived] [decimal](20, 7) NOT NULL,
	[AmountRelieved] [decimal](20, 7) NOT NULL,
	[AmountFuture] [decimal](20, 7) NOT NULL,
	[TaxRelieved] [decimal](20, 7) NOT NULL,
	[PriceOverrideCode] [char](1) NOT NULL,
	[PurchasingUnitCost] [decimal](20, 7) NOT NULL,
	[ExtendedCost] [decimal](20, 7) NOT NULL,
	[CostOverrideCode] [char](1) NOT NULL,
	[PurchasingCostingMethod] [char](1) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[ItemPriceGroupCode] [char](8) NOT NULL,
	[PricingCategoryLevel] [char](3) NOT NULL,
	[Catalog] [char](8) NOT NULL,
	[DiscountFactor] [decimal](20, 7) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[Taxable] [char](1) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[AssociatedText] [char](1) NOT NULL,
	[ContainerID] [char](20) NOT NULL,
	[CommodityCode] [char](15) NOT NULL,
	[NatureofTransaction] [char](2) NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[FreightCalculated] [char](1) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[RateCodeFreightMisc] [char](10) NOT NULL,
	[RateTypeFreightMisc] [char](1) NOT NULL,
	[BuyerNumber] [int] NOT NULL,
	[CarrierCode] [int] NOT NULL,
	[ModeOfTransportation] [char](3) NOT NULL,
	[ConditionsOfTransportation] [char](3) NOT NULL,
	[ShippingCommodityClass] [char](3) NOT NULL,
	[ShippingConditionsCode] [char](3) NOT NULL,
	[UnitOfMeasurePrimary] [char](2) NOT NULL,
	[PrimaryQuantityOrdered] [decimal](22, 7) NOT NULL,
	[UnitOfMeasureSecondary] [char](2) NOT NULL,
	[SecondaryQuantityOrdered] [decimal](22, 7) NOT NULL,
	[UnitOfMeasurePurchas] [char](2) NOT NULL,
	[UnitWeight] [decimal](20, 7) NOT NULL,
	[WeightUOM] [char](2) NOT NULL,
	[UnitVolume] [decimal](20, 7) NOT NULL,
	[VolumeUOM] [char](2) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[Century] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[LineStatus] [char](2) NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[ApplyFreight] [char](1) NOT NULL,
	[PostQuantities] [char](1) NOT NULL,
	[GrossWeight] [decimal](20, 7) NOT NULL,
	[GrossWeightUOM] [char](2) NOT NULL,
	[LedgerTypeCode] [char](2) NOT NULL,
	[AccountNumber] [char](29) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[PurchasingBusinessUnit] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[CostComponentNumber] [int] NOT NULL,
	[ReferenceTag] [char](8) NOT NULL,
	[Phase] [char](4) NOT NULL,
	[PenCode] [char](4) NOT NULL,
	[Elevation] [char](3) NOT NULL,
	[Category01Code] [char](3) NOT NULL,
	[RetainageRule] [char](3) NOT NULL,
	[LocalTaxCode] [char](2) NOT NULL,
	[PurgeCode] [char](1) NOT NULL,
	[ProcessingMode] [char](1) NOT NULL,
	[ClosedStatement] [char](1) NOT NULL,
	[EvaluatedReceipt] [char](1) NOT NULL,
	[PrePayment] [char](1) NOT NULL,
	[FreezeCode] [char](1) NOT NULL,
	[MatchType] [char](1) NOT NULL,
	[RoutingProcess] [char](1) NOT NULL,
	[LeadtimeRecalculated] [char](1) NOT NULL,
	[TransferOrDirectShipFlag] [char](1) NOT NULL,
	[PurchaseOrderStatus02] [char](1) NOT NULL,
	[PurchaseOrderStatus03] [char](1) NOT NULL,
	[PurchaseOrderStatus04] [char](1) NOT NULL,
	[PurchaseOrderStatus05] [char](1) NOT NULL,
	[PurchaseOrderStatus06] [char](1) NOT NULL,
	[PurchaseOrderStatus07] [char](1) NOT NULL,
	[PurchaseOrderStatus08] [char](1) NOT NULL,
	[PurchaseOrderStatus09] [char](1) NOT NULL,
	[PurchaseOrderStatus10] [char](1) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[ApprovalRouteCode] [char](12) NOT NULL,
	[ChangeOrder] [int] NOT NULL,
	[ChangeOrderType] [char](2) NOT NULL,
	[ChangeOrderNumber] [int] NOT NULL,
	[ChangeOrderLineNumber] [decimal](20, 7) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[ForeignUnitCost] [decimal](20, 7) NOT NULL,
	[ForeignExtendedPrice] [decimal](20, 7) NOT NULL,
	[ForeignUnitCost2] [decimal](20, 7) NOT NULL,
	[ForeignExtendedCost] [decimal](20, 7) NOT NULL,
	[ForeignChangedAmount] [decimal](20, 7) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[ForeignAmountReceived] [decimal](20, 7) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[OutsideReference2] [char](25) NOT NULL,
	[OutsideReference1] [char](25) NOT NULL,
	[ShipmentNumber] [int] NOT NULL,
	[RequestedShipTime] [int] NOT NULL,
	[ProjectNumber] [int] NOT NULL,
	[DocumentPayItemOriginal] [char](3) NOT NULL,
	[ItemRevisionLevel] [char](3) NOT NULL,
	[MatrixControlLineNumber] [decimal](20, 7) NOT NULL,
	[MultipleAccounts] [char](1) NOT NULL,
	[KitMasterLineNumber] [decimal](20, 7) NOT NULL,
	[AmountForeignTaxRelieved] [decimal](20, 7) NOT NULL,
	[DualUnitOfMeasureItem] [char](1) NOT NULL,
	[RequestedDeliveryTime] [int] NOT NULL,
	[LotEffectivityDate] [datetime] NOT NULL,
	[AmountForeignTax] [decimal](20, 7) NOT NULL,
	[ComponentLineNumber] [decimal](20, 7) NOT NULL,
	[ChangeOrderTimeofDay] [int] NOT NULL,
	[TimeScheduledRequiredHHMMSS] [int] NOT NULL,
	[ShiftCodeScheduledRequired] [char](1) NOT NULL,
	[ChangeOrderDateUpdated] [datetime] NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[Reference] [char](25) NOT NULL,
	[LoadNumber] [int] NOT NULL,
	[AddressNumberMarkfor] [int] NOT NULL,
	[PromotionID] [char](12) NOT NULL,
	[UniqueKeyIDInternal] [decimal](15, 0) NOT NULL,
	[UNSPSCCommodityCode] [char](8) NOT NULL,
	[CommodityCode01] [char](15) NOT NULL,
	[RelatedOrderSuffix] [char](3) NOT NULL,
	[HarvestID] [int] NOT NULL,
	[ContractID] [int] NOT NULL,
	[ContractDetailID] [int] NOT NULL,
	[ManualOverrideAdjustmentFlag] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPOPurchaseOrderDetail] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[OrderNumberDocumentCompany] ASC,
	[LineNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderSuffix] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPOPurchaseOrderDetail] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPOPurchaseOrderHeader]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPOPurchaseOrderHeader]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPOPurchaseOrderHeader](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalOrderNumber] [char](8) NOT NULL,
	[OriginalOrderTypeCode] [char](2) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ShipTo] [int] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[PromisedDeliveryDate] [datetime] NOT NULL,
	[OriginalPromisedDate] [datetime] NOT NULL,
	[ActualDeliveryDate] [datetime] NOT NULL,
	[CancelDate] [datetime] NOT NULL,
	[PriceEffectiveDate] [datetime] NOT NULL,
	[ShipDate] [datetime] NOT NULL,
	[FutureUseDate] [datetime] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[Reference2] [char](25) NOT NULL,
	[DeliveryInstructions01] [char](30) NOT NULL,
	[DeliveryInstructions02] [char](30) NOT NULL,
	[Remark] [char](30) NOT NULL,
	[Description] [char](30) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[PricingGroup] [char](8) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[Certificate] [char](20) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[AssociatedText] [char](1) NOT NULL,
	[InvoiceCopies] [int] NOT NULL,
	[NatureofTransaction] [char](2) NOT NULL,
	[ContainerID] [char](20) NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[BuyerNumber] [int] NOT NULL,
	[CarrierCode] [int] NOT NULL,
	[ModeOfTransportation] [char](3) NOT NULL,
	[ConditionsOfTransportation] [char](3) NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[FreightCalculated] [char](1) NOT NULL,
	[ApplyFreight] [char](1) NOT NULL,
	[PostQuantities] [char](1) NOT NULL,
	[OrderGrossAmount] [decimal](20, 7) NOT NULL,
	[RetainagePercent] [decimal](20, 7) NOT NULL,
	[RetainageRule] [char](3) NOT NULL,
	[WeightDisplayedUOM] [char](2) NOT NULL,
	[VolumeDisplayedUOM] [char](2) NOT NULL,
	[PurgeCode] [char](1) NOT NULL,
	[LogicControlIndicator] [char](1) NOT NULL,
	[ProcessingMode] [char](1) NOT NULL,
	[MatchType] [char](1) NOT NULL,
	[PurchaseOrderStatus] [char](1) NOT NULL,
	[EvaluatedReceipt] [char](1) NOT NULL,
	[PrePayment] [char](1) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[PurchasingCategory05Code] [char](3) NOT NULL,
	[ApprovalRouteCode] [char](12) NOT NULL,
	[ChangeOrder] [int] NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[LanguagePreferenceCode] [char](2) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[OrderedBy] [char](10) NOT NULL,
	[OrderTakenBy] [char](10) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[RequestedShipTime] [int] NOT NULL,
	[RequestedDeliveryTime] [int] NOT NULL,
	[DocumentOrderInvoiceetc] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[AddressNumberMarkfor] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPOPurchaseOrderHeader] PRIMARY KEY CLUSTERED 
(
	[OrderNumberDocumentCompany] ASC,
	[OrderNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderSuffix] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPOPurchaseOrderHeader] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPOPurchaseOrderReceiver]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPOPurchaseOrderReceiver]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPOPurchaseOrderReceiver](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[MatchRecordType] [char](1) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[NumberofLines] [int] NOT NULL,
	[AssociatedLineNumber] [decimal](20, 7) NOT NULL,
	[WrittenbyProgram] [char](2) NOT NULL,
	[ContractNumber] [char](12) NOT NULL,
	[ContractSupplement] [int] NOT NULL,
	[ContractBalancesUpdated] [char](1) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[ItemCostCenter] [char](12) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[LotGrade] [char](3) NOT NULL,
	[LotPotency] [decimal](20, 7) NOT NULL,
	[VendorRemark] [char](30) NOT NULL,
	[ContainerID] [char](20) NOT NULL,
	[StatusCodeNext] [char](3) NOT NULL,
	[StatusCodeLast] [char](3) NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[ReceiptDate] [datetime] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[PromisedDeliveryDate] [datetime] NOT NULL,
	[OriginalPromisedDate] [datetime] NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[InvoiceNumber] [char](25) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[PayStatus] [char](1) NOT NULL,
	[LandedCostCode] [char](1) NOT NULL,
	[PurchasingCategory05Code] [char](3) NOT NULL,
	[LevelCost] [char](3) NOT NULL,
	[InvoiceLoggingCode] [char](1) NOT NULL,
	[InvoiceLoggingDist] [char](1) NOT NULL,
	[RoutingProcess] [char](1) NOT NULL,
	[LeadtimeRecalculated] [char](1) NOT NULL,
	[EvaluatedReceipt] [char](1) NOT NULL,
	[LineType] [char](2) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[AccountNumber] [char](29) NOT NULL,
	[PurchasingBusinessUnit] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[SerialNumber] [char](25) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[PayItem] [char](3) NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[JournalEntryLineNumber] [decimal](20, 7) NOT NULL,
	[ReceivedNotVoucher] [char](29) NOT NULL,
	[Taxable] [char](1) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[QuantityPaidtoDate] [decimal](22, 7) NOT NULL,
	[QuantityOpen] [decimal](22, 7) NOT NULL,
	[ReceivedQuantity] [decimal](22, 7) NOT NULL,
	[ClosedQuantity] [decimal](22, 7) NOT NULL,
	[QuantityStocked] [decimal](22, 7) NOT NULL,
	[QuantityReturned] [decimal](22, 7) NOT NULL,
	[QuantityReworked] [decimal](22, 7) NOT NULL,
	[QuantityScrapped] [decimal](22, 7) NOT NULL,
	[QuantityRejected] [decimal](22, 7) NOT NULL,
	[QuantityAdjusted] [decimal](22, 7) NOT NULL,
	[UnitOfMeasurePurchas] [char](2) NOT NULL,
	[PurchasingUnitPrice] [decimal](20, 7) NOT NULL,
	[ExtendedCost] [decimal](20, 7) NOT NULL,
	[AmountPaidtoDate] [decimal](20, 7) NOT NULL,
	[AmountOpen] [decimal](20, 7) NOT NULL,
	[AmountReceived] [decimal](20, 7) NOT NULL,
	[AmountClosed] [decimal](20, 7) NOT NULL,
	[AverageCostDifference] [decimal](20, 7) NOT NULL,
	[CostVariance] [decimal](20, 7) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[ForeignUnitCost] [decimal](20, 7) NOT NULL,
	[ForeignExtendedCost] [decimal](20, 7) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[ForeignAmountPayed] [decimal](20, 7) NOT NULL,
	[ForeignAmountReceived] [decimal](20, 7) NOT NULL,
	[ForeignAmountClosed] [decimal](20, 7) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[TerminalIdentification] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[AmountTax] [decimal](20, 7) NOT NULL,
	[AmountForeignTax] [decimal](20, 7) NOT NULL,
	[MultipleAccounts] [char](1) NOT NULL,
	[SSCCNumberTareLevel] [char](18) NOT NULL,
	[SSCCNumberPackLevel] [char](18) NOT NULL,
	[SCCNumber] [char](14) NOT NULL,
	[SCCQuantity] [decimal](22, 7) NOT NULL,
	[SCCUnitofMeasure] [char](2) NOT NULL,
	[UPCNumber] [char](13) NOT NULL,
	[UPCQuantity] [decimal](22, 7) NOT NULL,
	[UPCUnitofMeasure] [char](2) NOT NULL,
	[ShipmentNumber] [int] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[Reference2] [char](25) NOT NULL,
	[FutureUse3] [char](1) NOT NULL,
	[FutureUse4] [char](1) NOT NULL,
	[FutureUse5] [char](1) NOT NULL,
	[FutureUse6] [char](1) NOT NULL,
	[ItemRevisionLevel] [char](3) NOT NULL,
	[KitMasterLineNumber] [decimal](20, 7) NOT NULL,
	[ComponentLineNumber] [decimal](20, 7) NOT NULL,
	[OutsideReference1] [char](25) NOT NULL,
	[OutsideReference2] [char](25) NOT NULL,
	[UniqueKeyIDInternal] [int] NOT NULL,
	[UnitMeasureSecondary] [char](2) NOT NULL,
	[DualUnitOfMeasureItem] [char](1) NOT NULL,
	[UnitsSecondaryQuantityOrdered] [decimal](22, 7) NOT NULL,
	[CrossDockingFlag] [char](1) NOT NULL,
	[PortofEntryorExit] [char](6) NOT NULL,
	[Reference03] [char](25) NOT NULL,
	[LoadNumber] [int] NOT NULL,
	[ContainerSerialNumber] [char](40) NOT NULL,
	[PriceOverrideCode] [char](1) NOT NULL,
	[PriceAndAdjustmentSchedule] [char](8) NOT NULL,
	[PricingControl01] [char](1) NOT NULL,
	[PricingControl02] [char](1) NOT NULL,
	[ManualOverrideAdjustmentFlag] [char](1) NOT NULL,
	[PurchaseOrderStatus09] [char](1) NOT NULL,
	[QuantityToPay] [int] NOT NULL,
	[HarvestID] [int] NOT NULL,
	[ContractID] [int] NOT NULL,
	[ContractDetailID] [int] NOT NULL,
	[ReviewedFlag] [char](1) NOT NULL,
	[ApprovedFlag] [char](1) NOT NULL,
	[ReviewedByAddressNumber] [int] NOT NULL,
	[ApprovedByAddressNumber] [int] NOT NULL,
	[OperationID] [int] NOT NULL,
	[VesselClass] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPOPurchaseOrderReceiver] PRIMARY KEY CLUSTERED 
(
	[MatchRecordType] ASC,
	[OrderNumberDocumentCompany] ASC,
	[OrderNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderSuffix] ASC,
	[LineNumber] ASC,
	[NumberofLines] ASC,
	[DocumentNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPOPurchaseOrderReceiver] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPYDBATransactionDetailHist]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPYDBATransactionDetailHist]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPYDBATransactionDetailHist](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[CheckControlNumber] [int] NOT NULL,
	[MonthUpdateofHistory] [int] NOT NULL,
	[DateWorked] [datetime] NOT NULL,
	[DatePayPeriodEnding] [datetime] NOT NULL,
	[DatePayCheck] [datetime] NOT NULL,
	[DBACode] [int] NOT NULL,
	[UniqueKeyIDInternal] [decimal](15, 0) NOT NULL,
	[TransactionNoPayroll] [int] NOT NULL,
	[COBRAPlan] [int] NOT NULL,
	[DBAType] [char](1) NOT NULL,
	[AmountorRate] [decimal](20, 7) NOT NULL,
	[MethodofCalculation] [char](1) NOT NULL,
	[CompanyHome] [char](5) NOT NULL,
	[AmountGrossPay] [decimal](20, 7) NOT NULL,
	[AmountArrearage] [decimal](20, 7) NOT NULL,
	[HoursWorked] [decimal](20, 7) NOT NULL,
	[BusinessUnitDBAAllocation] [char](12) NOT NULL,
	[CalendarMonthMethod] [char](1) NOT NULL,
	[DBACalculationBasis] [decimal](20, 7) NOT NULL,
	[UnionCode] [char](6) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[WorkState] [int] NOT NULL,
	[WorkCounty] [int] NOT NULL,
	[WorkCity] [int] NOT NULL,
	[AddressNumberProviderTrustee] [int] NOT NULL,
	[WorkersComp] [char](4) NOT NULL,
	[SubClassWorkersComp] [char](1) NOT NULL,
	[DeductBenefitOverrideCode] [char](2) NOT NULL,
	[EffectonDisposableWage] [char](1) NOT NULL,
	[InterimCheckCode] [char](1) NOT NULL,
	[InterimCheckStatus] [char](1) NOT NULL,
	[PayrollLockoutIdentification] [char](18) NOT NULL,
	[DeductionFactor] [char](1) NOT NULL,
	[DateTimeStamp] [datetime] NOT NULL,
	[MethodofPrinting] [char](1) NOT NULL,
	[ProcessedCode] [char](1) NOT NULL,
	[GeneralLedgerBatchNumber] [int] NOT NULL,
	[CheckCommentYN] [char](1) NOT NULL,
	[PayrollControlNumber] [int] NOT NULL,
	[NameAlphaSort] [char](12) NOT NULL,
	[APVoucherYN] [char](1) NOT NULL,
	[WageAttachControlNumber] [int] NOT NULL,
	[CalculateIfNoGrossYN] [char](1) NOT NULL,
	[OrderToAdjustDed] [int] NOT NULL,
	[WhenToAdjustDed] [char](1) NOT NULL,
	[ArrearageMethod] [char](1) NOT NULL,
	[DBACalculationLevel] [char](1) NOT NULL,
	[CodeTaxAreaDeduction] [char](1) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[LastTimeUpdated] [int] NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPYDBATransactionDetailHistory] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[CheckControlNumber] ASC,
	[DatePayPeriodEnding] ASC,
	[DBACode] ASC,
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPYDBATransactionDetailHist] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPYEmployeeMasterInfo]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPYEmployeeMasterInfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPYEmployeeMasterInfo](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[EmployeeTaxID] [char](20) NOT NULL,
	[AlternateEmployeeNo] [char](8) NOT NULL,
	[GenderMaleFemale] [char](1) NOT NULL,
	[MaritalStatusTax] [char](1) NOT NULL,
	[MaritalStatusStateTax] [char](1) NOT NULL,
	[ResidencyStatus] [char](1) NOT NULL,
	[EarnedIncomeCreditStatus] [char](1) NOT NULL,
	[Dependents] [int] NOT NULL,
	[EmploymentStatus] [char](1) NOT NULL,
	[EmployeeClassificationStatus] [char](1) NOT NULL,
	[TaxAreaResidence] [char](10) NOT NULL,
	[TaxAreaWork] [char](10) NOT NULL,
	[SchoolDistrictCode] [int] NOT NULL,
	[StateHome] [char](3) NOT NULL,
	[StateWorking] [char](3) NOT NULL,
	[LocationHomeCity] [char](3) NOT NULL,
	[LocationWorkCity] [char](3) NOT NULL,
	[LocationWorkCounty] [char](3) NOT NULL,
	[CompanyHome] [char](5) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[HomeBusinessUnit] [char](12) NOT NULL,
	[LastJobWorked] [char](12) NOT NULL,
	[RoutingCodeCheck] [char](10) NOT NULL,
	[EmployeePayStatus] [char](1) NOT NULL,
	[PayFrequency] [char](1) NOT NULL,
	[PayClassHSP] [char](1) NOT NULL,
	[PayCycleBypassCount] [int] NOT NULL,
	[BenefitCycleBypassCount] [int] NOT NULL,
	[UnionCode] [char](6) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[JobCategoryEEO] [char](3) NOT NULL,
	[EthnicCode] [char](2) NOT NULL,
	[ChangeReason] [char](3) NOT NULL,
	[WorkersComp] [char](4) NOT NULL,
	[FLSAExemptYN] [char](1) NOT NULL,
	[WorkScheduleCode] [char](1) NOT NULL,
	[ShiftCode] [char](1) NOT NULL,
	[LaborDistributionMethod] [char](1) NOT NULL,
	[RateDistributionorBilling] [decimal](20, 7) NOT NULL,
	[LaborDistributionMultiplier] [decimal](20, 7) NOT NULL,
	[RateSalaryAnnual] [decimal](20, 7) NOT NULL,
	[RateHourly] [decimal](20, 7) NOT NULL,
	[RatePiecework] [decimal](20, 7) NOT NULL,
	[RatePieceworkatNextRaise] [decimal](20, 7) NOT NULL,
	[RateHourlyatNextRaise] [decimal](20, 7) NOT NULL,
	[RateBillingatNextRaise] [decimal](20, 7) NOT NULL,
	[RateSalaryatNextRaise] [decimal](20, 7) NOT NULL,
	[HoursStandardperPayperiod] [decimal](20, 7) NOT NULL,
	[HoursStandardperDay] [decimal](20, 7) NOT NULL,
	[DaysStandardperYear] [decimal](20, 7) NOT NULL,
	[PayrollLockoutIdentification] [char](18) NOT NULL,
	[UpdateFlag] [char](1) NOT NULL,
	[WorkTaxAreaSource] [char](1) NOT NULL,
	[InitialFirstNameGovtRpts] [char](1) NOT NULL,
	[InitialMiddleNameGovtRpts] [char](1) NOT NULL,
	[DateBirth] [datetime] NOT NULL,
	[DateOriginalEmployment] [datetime] NOT NULL,
	[DateTerminated] [datetime] NOT NULL,
	[DataItemSecondary] [datetime] NOT NULL,
	[DatePayStarts] [datetime] NOT NULL,
	[DatePayStops] [datetime] NOT NULL,
	[DateNextRaise] [datetime] NOT NULL,
	[DateNewBillRate] [datetime] NOT NULL,
	[DateNewPiecerate] [datetime] NOT NULL,
	[DateLastCheck] [datetime] NOT NULL,
	[DateLastRaise] [datetime] NOT NULL,
	[DateLastContact] [datetime] NOT NULL,
	[DateLOAExpirationDate] [datetime] NOT NULL,
	[DateBonus] [datetime] NOT NULL,
	[DateCurrentPosition] [datetime] NOT NULL,
	[TaxCalcMethod] [char](1) NOT NULL,
	[Category01CodePayroll] [char](3) NOT NULL,
	[Category01Payroll] [char](30) NOT NULL,
	[Category02CodePayroll] [char](3) NOT NULL,
	[Category02Payroll] [char](30) NOT NULL,
	[Category03CodePayroll] [char](3) NOT NULL,
	[Category03Payroll] [char](30) NOT NULL,
	[Category04CodePayroll] [char](3) NOT NULL,
	[Category04Payroll] [char](30) NOT NULL,
	[Category05CodePayroll] [char](3) NOT NULL,
	[Category05Payroll] [char](30) NOT NULL,
	[Category06CodePayroll] [char](3) NOT NULL,
	[Category06Payroll] [char](30) NOT NULL,
	[Category07CodePayroll] [char](3) NOT NULL,
	[Category07Payroll] [char](30) NOT NULL,
	[Category08CodePayroll] [char](3) NOT NULL,
	[Category08Payroll] [char](30) NOT NULL,
	[Category09CodePayroll] [char](3) NOT NULL,
	[Category09Payroll] [char](30) NOT NULL,
	[Category10CodePayroll] [char](3) NOT NULL,
	[Category10Payroll] [char](30) NOT NULL,
	[Category11CodePayroll] [char](3) NOT NULL,
	[Category11Payroll] [char](30) NOT NULL,
	[Category12CodePayroll] [char](3) NOT NULL,
	[Category12Payroll] [char](30) NOT NULL,
	[Category13CodePayroll] [char](3) NOT NULL,
	[Category13Payroll] [char](30) NOT NULL,
	[Category14CodePayroll] [char](3) NOT NULL,
	[Category14Payroll] [char](30) NOT NULL,
	[Category15CodePayroll] [char](3) NOT NULL,
	[Category15Payroll] [char](30) NOT NULL,
	[Category16CodePayroll] [char](3) NOT NULL,
	[Category16Payroll] [char](30) NOT NULL,
	[Category17CodePayroll] [char](3) NOT NULL,
	[Category17Payroll] [char](30) NOT NULL,
	[Category18CodePayroll] [char](3) NOT NULL,
	[Category18Payroll] [char](30) NOT NULL,
	[Category19CodePayroll] [char](3) NOT NULL,
	[Category19Payroll] [char](30) NOT NULL,
	[Category20CodePayroll] [char](3) NOT NULL,
	[Category20Payroll] [char](30) NOT NULL,
	[EligibilityCode001] [char](1) NOT NULL,
	[EligibilityCode002] [char](1) NOT NULL,
	[EligibilityCode003] [char](1) NOT NULL,
	[EligibilityCode004] [char](1) NOT NULL,
	[EligibilityCode005] [char](1) NOT NULL,
	[EligibilityCode006] [char](1) NOT NULL,
	[EligibilityCode007] [char](1) NOT NULL,
	[EligibilityCode008] [char](1) NOT NULL,
	[EligibilityCode009] [char](1) NOT NULL,
	[EligibilityCode010] [char](1) NOT NULL,
	[InterimCheckCode] [char](1) NOT NULL,
	[AmountMaximumNetPay] [decimal](20, 7) NOT NULL,
	[StandardOccupationalClassCode] [char](4) NOT NULL,
	[UserIDInterimCheckEnterer] [char](10) NOT NULL,
	[TerminalIdInterimCheck] [char](10) NOT NULL,
	[InterimProcessingBatchFlag] [char](1) NOT NULL,
	[Region] [char](3) NOT NULL,
	[NumberofPayGradeSteps] [char](4) NOT NULL,
	[HoursperStandardYear] [decimal](20, 7) NOT NULL,
	[CountryCode] [char](3) NOT NULL,
	[PreNoteCode] [char](1) NOT NULL,
	[ThirdCountryNationalFlag] [char](1) NOT NULL,
	[ResidentAlienFlag] [char](1) NOT NULL,
	[EmployeeCodeTippedYN] [char](1) NOT NULL,
	[RecordType] [char](1) NOT NULL,
	[RateRechargeBurden] [decimal](20, 7) NOT NULL,
	[RateNewRechargeBurdenRate] [decimal](20, 7) NOT NULL,
	[DateNewBillRate02] [datetime] NOT NULL,
	[SubClassWorkersComp] [char](1) NOT NULL,
	[AddressFlag] [char](1) NOT NULL,
	[MaritalStatusResidentState] [char](1) NOT NULL,
	[LocalAreaMaritalStatus] [char](1) NOT NULL,
	[FlagLanguagePreference] [char](2) NOT NULL,
	[AmountCashAccumulator] [decimal](20, 7) NOT NULL,
	[FlagCashRounding] [char](1) NOT NULL,
	[PayCycleCode] [char](5) NOT NULL,
	[DateEmployeeRecall] [datetime] NOT NULL,
	[DateLOABeginningDate] [datetime] NOT NULL,
	[DateParticipation] [datetime] NOT NULL,
	[MethodEmployeePayment] [char](1) NOT NULL,
	[ProcessedCodePayroll] [char](1) NOT NULL,
	[DateTimeStamp] [bigint] NOT NULL,
	[AddressNumberProviderTrustee] [int] NOT NULL,
	[PayPeriodNumber] [char](3) NOT NULL,
	[DatePayCycleProcessed] [datetime] NOT NULL,
	[CashBenefit] [char](1) NOT NULL,
	[BirthdayMonth] [int] NOT NULL,
	[StartdateMonth] [int] NOT NULL,
	[RatePreviousSalary] [decimal](20, 7) NOT NULL,
	[MedicalPlanID] [char](11) NOT NULL,
	[CreditMessageCode] [char](2) NOT NULL,
	[RateLifeInsAnnualSalary] [decimal](20, 7) NOT NULL,
	[BenefitGroup] [char](6) NOT NULL,
	[SharesFlagVoting] [char](1) NOT NULL,
	[PriorYearsforCalculatingVest] [decimal](20, 7) NOT NULL,
	[Supervisor] [int] NOT NULL,
	[PayGrade] [char](6) NOT NULL,
	[PayGradeStep] [char](4) NOT NULL,
	[SalaryDataLocality] [char](8) NOT NULL,
	[DateNextReview] [datetime] NOT NULL,
	[TypeofIncreaseNextReview] [char](1) NOT NULL,
	[Category01CodeApplicant] [char](1) NOT NULL,
	[Category01Applicant] [char](30) NOT NULL,
	[Category02CodeApplicant] [char](1) NOT NULL,
	[Category02Applicant] [char](30) NOT NULL,
	[Category03CodeApplicant] [char](1) NOT NULL,
	[Category03Applicant] [char](30) NOT NULL,
	[Category04CodeApplicant] [char](1) NOT NULL,
	[Category04Applicant] [char](30) NOT NULL,
	[PositionID] [char](8) NOT NULL,
	[DateUserDefined01] [datetime] NOT NULL,
	[DateUserDefined02] [datetime] NOT NULL,
	[DateUserDefined03] [datetime] NOT NULL,
	[DateUserDefined04] [datetime] NOT NULL,
	[DateUserDefined05] [datetime] NOT NULL,
	[DateUserDefined06] [datetime] NOT NULL,
	[DateUserDefined07] [datetime] NOT NULL,
	[DateUserDefined08] [datetime] NOT NULL,
	[DateUserDefined09] [datetime] NOT NULL,
	[DateUserDefined10] [datetime] NOT NULL,
	[DateUserDefined11] [datetime] NOT NULL,
	[DateUserDefined12] [datetime] NOT NULL,
	[DateUserDefined13] [datetime] NOT NULL,
	[DateUserDefined14] [datetime] NOT NULL,
	[DateUserDefined15] [datetime] NOT NULL,
	[DateUserDefined16] [datetime] NOT NULL,
	[DateUserDefined17] [datetime] NOT NULL,
	[DateUserDefined18] [datetime] NOT NULL,
	[DateUserDefined19] [datetime] NOT NULL,
	[DateUserDefined20] [datetime] NOT NULL,
	[DepartmentCode] [char](12) NOT NULL,
	[AgeEmployee] [int] NOT NULL,
	[RateLifeInsAnnualSalaryFixed] [decimal](20, 7) NOT NULL,
	[DateAdjustedServiceDate] [datetime] NOT NULL,
	[CompaRatio] [decimal](20, 7) NOT NULL,
	[JobEvaluationPoints] [int] NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[NDTCodeOwnerOfficer] [char](1) NOT NULL,
	[NDTCodeLookBackYrTop20Percent] [char](1) NOT NULL,
	[NDTCodeLookBackYearHCE] [char](1) NOT NULL,
	[NDTCodeDeterminationYrTop20] [char](1) NOT NULL,
	[NDTCodeDeterminationYrTop100] [char](1) NOT NULL,
	[NDTCodeDeterminationYrTop10] [char](1) NOT NULL,
	[NDTCodeDeterminationYrHCE] [char](1) NOT NULL,
	[NDTCodesMinHoursEligibility] [char](1) NOT NULL,
	[Non401kDiscriminationTest009] [char](1) NOT NULL,
	[Non401kDiscriminationTest010] [char](1) NOT NULL,
	[PayrollAutopayPaytype] [int] NOT NULL,
	[PensionCode] [char](1) NOT NULL,
	[OregonInsurance] [char](1) NOT NULL,
	[EmployeeBenefitStatus] [char](1) NOT NULL,
	[FullTimeEquivalents] [decimal](20, 7) NOT NULL,
	[VacationFactor] [char](1) NOT NULL,
	[SourceofSUIReporting] [char](1) NOT NULL,
	[SalaryForecastChangeDate] [datetime] NOT NULL,
	[PeriodsPaidPerYear] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPYEmployeeMasterInformation] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPYEmployeeMasterInfo] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPYEmployeeTransactionDetl]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPYEmployeeTransactionDetl]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPYEmployeeTransactionDetl](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[NameAlphaSort] [char](12) NOT NULL,
	[TransactionNoPayroll] [int] NOT NULL,
	[RecordType] [char](1) NOT NULL,
	[CheckControlNumber] [int] NOT NULL,
	[AccountMode01] [char](1) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[CompanyHome] [char](5) NOT NULL,
	[HomeBusinessUnit] [char](12) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[CompanyRecharge] [char](5) NOT NULL,
	[BusinessUnitRecharge] [char](12) NOT NULL,
	[ObjectAccountRecharge] [char](6) NOT NULL,
	[SubsidiaryRecharge] [char](8) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[Phase] [char](4) NOT NULL,
	[BusinessUnitChargeout] [char](12) NOT NULL,
	[RoutingCodeCheck] [char](10) NOT NULL,
	[HoursWorked] [decimal](20, 7) NOT NULL,
	[OperationsSequenceNumber] [decimal](20, 7) NOT NULL,
	[LaborTypeRoutingInstructions] [char](1) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[UnitsPieces] [decimal](20, 7) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[RateHourly] [decimal](20, 7) NOT NULL,
	[RatePiecework] [decimal](20, 7) NOT NULL,
	[RateBaseHourly] [decimal](20, 7) NOT NULL,
	[RateDistributionorBilling] [decimal](20, 7) NOT NULL,
	[RateRechargeBurden] [decimal](20, 7) NOT NULL,
	[RateHourlyExtended] [decimal](20, 7) NOT NULL,
	[ShiftCode] [char](1) NOT NULL,
	[AmountShiftDifferential] [decimal](20, 7) NOT NULL,
	[MultiplierPayTypeMultiplier] [decimal](20, 7) NOT NULL,
	[PercentorAmount] [char](1) NOT NULL,
	[AmountGrossPay] [decimal](20, 7) NOT NULL,
	[AmountDistributedGrossPay] [decimal](20, 7) NOT NULL,
	[RechargeAmount] [decimal](20, 7) NOT NULL,
	[AmountSalesGenerated] [decimal](20, 7) NOT NULL,
	[UnionCode] [char](6) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[WorkState] [int] NOT NULL,
	[WorkCounty] [int] NOT NULL,
	[WorkCity] [int] NOT NULL,
	[WorkersComp] [char](4) NOT NULL,
	[SubClassWorkersComp] [char](1) NOT NULL,
	[GeneralLiabilityPremiumAmount] [decimal](20, 7) NOT NULL,
	[WorkersCompPremiumAmount] [decimal](20, 7) NOT NULL,
	[WorkersCompPremiumBase] [decimal](20, 7) NOT NULL,
	[GeneralLiabilityPremiumBase] [decimal](20, 7) NOT NULL,
	[WorkersCompOvertimeAmount] [decimal](20, 7) NOT NULL,
	[GeneralLiabilityOvertimeAmount] [decimal](20, 7) NOT NULL,
	[WorkersCompExcludableAmount] [decimal](20, 7) NOT NULL,
	[GeneralLiabilityExcludableAmt] [decimal](20, 7) NOT NULL,
	[WorkersCompensationBenefitAmt] [decimal](20, 7) NOT NULL,
	[MonthUpdateofHistory] [int] NOT NULL,
	[DBACode] [int] NOT NULL,
	[SourceofPay] [char](1) NOT NULL,
	[MethodofCalculation] [char](1) NOT NULL,
	[PayClassHSP] [char](1) NOT NULL,
	[EffectonGL] [char](1) NOT NULL,
	[PayFrequency] [char](1) NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[DateWorked] [datetime] NOT NULL,
	[DayoftheWeek] [char](1) NOT NULL,
	[DatePayPeriodEnding] [datetime] NOT NULL,
	[PayPeriodoftheMonth] [char](1) NOT NULL,
	[DateTimeClockStartDateandTime] [datetime] NOT NULL,
	[DateTimeClockEnd] [datetime] NOT NULL,
	[CompanyEquipment] [char](5) NOT NULL,
	[EquipmentWorkedOn] [char](9) NOT NULL,
	[EquipmentWorked] [char](9) NOT NULL,
	[EquipmentObjectAccount] [char](6) NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[BillingRateEquipment] [decimal](20, 7) NOT NULL,
	[AmountEquipmentGross] [decimal](20, 7) NOT NULL,
	[HoursEquipment] [decimal](20, 7) NOT NULL,
	[RemarkExplaination] [char](30) NOT NULL,
	[Category01CodePayroll] [char](3) NOT NULL,
	[Category01Payroll] [char](30) NOT NULL,
	[Category02CodePayroll] [char](3) NOT NULL,
	[Category02Payroll] [char](30) NOT NULL,
	[Category03CodePayroll] [char](3) NOT NULL,
	[Category03Payroll] [char](30) NOT NULL,
	[Category04CodePayroll] [char](3) NOT NULL,
	[Category04Payroll] [char](30) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[CheckCommentYN] [char](1) NOT NULL,
	[DatePayCheck] [datetime] NOT NULL,
	[AmountUprate] [decimal](20, 7) NOT NULL,
	[ProcessedCode] [char](1) NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[GeneralLedgerBatchNumber] [int] NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[AccountNumber] [char](29) NOT NULL,
	[Century] [int] NOT NULL,
	[AddressNumberProviderTrustee] [int] NOT NULL,
	[DeductBenefitOverrideCode] [char](2) NOT NULL,
	[EffectonGrossPay] [char](1) NOT NULL,
	[EffectonNetPay] [char](1) NOT NULL,
	[VoidFlagYN] [char](1) NOT NULL,
	[WorkScheduleCode] [char](1) NOT NULL,
	[MethodofPrinting] [char](1) NOT NULL,
	[InterimCheckCode] [char](1) NOT NULL,
	[InterimCheckStatus] [char](1) NOT NULL,
	[ShiftDiffCalcSequence] [char](1) NOT NULL,
	[AvailableDBA] [char](1) NOT NULL,
	[TypeSales] [char](1) NOT NULL,
	[SecurityIndicator] [char](1) NOT NULL,
	[OvertimeCode] [char](1) NOT NULL,
	[DeductionPeriod01] [char](1) NOT NULL,
	[DeductionPeriod02] [char](1) NOT NULL,
	[DeductionPeriod03] [char](1) NOT NULL,
	[DeductionPeriod04] [char](1) NOT NULL,
	[DeductionPeriod05] [char](1) NOT NULL,
	[DeductionPeriod06] [char](1) NOT NULL,
	[NonTaxableAuthorityTypes01] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes02] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes03] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes04] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes05] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes06] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes07] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes08] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes09] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes10] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes11] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes12] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes13] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes14] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes15] [char](2) NOT NULL,
	[PayrollLockoutIdentification] [char](18) NOT NULL,
	[AmountEnteredGrossPay] [decimal](20, 7) NOT NULL,
	[BenefitFactor] [decimal](20, 7) NOT NULL,
	[RateWorkersCompInsurance] [decimal](20, 7) NOT NULL,
	[RateWorkersCompGenLiability] [decimal](20, 7) NOT NULL,
	[AdvanceonPay] [char](1) NOT NULL,
	[StatusTipHistUpdate] [char](1) NOT NULL,
	[AlphaName] [char](40) NOT NULL,
	[AutoPayMethods] [char](1) NOT NULL,
	[TaxCalcMethod] [char](1) NOT NULL,
	[TableCode] [char](5) NOT NULL,
	[DateTimeStamp] [datetime] NOT NULL,
	[StatusPayroll01] [char](1) NOT NULL,
	[SpendingAccountClaimNumber] [char](15) NOT NULL,
	[LaborCostingFlag] [char](1) NOT NULL,
	[PositionID] [char](8) NOT NULL,
	[PublicFlag] [char](1) NOT NULL,
	[SickCertificateRequired] [char](1) NOT NULL,
	[SickCertificateReceived] [char](1) NOT NULL,
	[BenefitAccrualType] [char](1) NOT NULL,
	[PayInAdvance] [char](1) NOT NULL,
	[TimecardFromDate] [datetime] NOT NULL,
	[TimecardThruDate] [datetime] NOT NULL,
	[HoursWorkedPerDay] [decimal](20, 7) NOT NULL,
	[InstanceIdentifier] [char](36) NOT NULL,
	[UnionTimecardOverride] [char](1) NOT NULL,
	[HomeCompanyTimecardOverride] [char](1) NOT NULL,
	[HomeBusinessUnitTimecrdOvrride] [char](1) NOT NULL,
	[JobTypeTimecardOverride] [char](1) NOT NULL,
	[JobStepTimecardOverride] [char](1) NOT NULL,
	[HourlyRateTimecardOverride] [char](1) NOT NULL,
	[ShiftCodeTimecardOverride] [char](1) NOT NULL,
	[ShftDifferentialTimecrdOvrride] [char](1) NOT NULL,
	[BillingRateTimecardOverride] [char](1) NOT NULL,
	[PieceRateTimecardOverride] [char](1) NOT NULL,
	[WorkersCompCodeTimecrdOvrride] [char](1) NOT NULL,
	[WrkerCompSubClassTimecrdOverri] [char](1) NOT NULL,
	[BuisUnitChargeoutTimecrdOverri] [char](1) NOT NULL,
	[AccountNumberTimecardOverride] [char](1) NOT NULL,
	[TimecardReprocessFlag] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPYEmployeeTransactionDetailFile] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[TransactionNoPayroll] ASC,
	[DateWorked] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPYEmployeeTransactionDetl] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPYEmployeeTransactionHist]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPYEmployeeTransactionHist]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPYEmployeeTransactionHist](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[NameAlphaSort] [char](12) NOT NULL,
	[TransactionNoPayroll] [int] NOT NULL,
	[RecordType] [char](1) NOT NULL,
	[CheckControlNumber] [int] NOT NULL,
	[AccountMode01] [char](1) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[CompanyHome] [char](5) NOT NULL,
	[HomeBusinessUnit] [char](12) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[CompanyRecharge] [char](5) NOT NULL,
	[BusinessUnitRecharge] [char](12) NOT NULL,
	[ObjectAccountRecharge] [char](6) NOT NULL,
	[SubsidiaryRecharge] [char](8) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[Phase] [char](4) NOT NULL,
	[BusinessUnitChargeout] [char](12) NOT NULL,
	[RoutingCodeCheck] [char](10) NOT NULL,
	[HoursWorked] [decimal](20, 7) NOT NULL,
	[OperationsSequenceNumber] [decimal](20, 7) NOT NULL,
	[LaborTypeRoutingInstructions] [char](1) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[UnitsPieces] [decimal](20, 7) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[RateHourly] [decimal](20, 7) NOT NULL,
	[RatePiecework] [decimal](20, 7) NOT NULL,
	[RateBaseHourly] [decimal](20, 7) NOT NULL,
	[RateDistributionorBilling] [decimal](20, 7) NOT NULL,
	[RateRechargeBurden] [decimal](20, 7) NOT NULL,
	[RateHourlyExtended] [decimal](20, 7) NOT NULL,
	[ShiftCode] [char](1) NOT NULL,
	[AmountShiftDifferential] [decimal](20, 7) NOT NULL,
	[MultiplierPayTypeMultiplier] [decimal](20, 7) NOT NULL,
	[PercentorAmount] [char](1) NOT NULL,
	[AmountGrossPay] [decimal](20, 7) NOT NULL,
	[AmountDistributedGrossPay] [decimal](20, 7) NOT NULL,
	[RechargeAmount] [decimal](20, 7) NOT NULL,
	[AmountSalesGenerated] [decimal](20, 7) NOT NULL,
	[UnionCode] [char](6) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[JobStep] [char](4) NOT NULL,
	[WorkState] [int] NOT NULL,
	[WorkCounty] [int] NOT NULL,
	[WorkCity] [int] NOT NULL,
	[WorkersComp] [char](4) NOT NULL,
	[SubClassWorkersComp] [char](1) NOT NULL,
	[GeneralLiabilityPremiumAmount] [decimal](20, 7) NOT NULL,
	[WorkersCompPremiumAmount] [decimal](20, 7) NOT NULL,
	[WorkersCompPremiumBase] [decimal](20, 7) NOT NULL,
	[GeneralLiabilityPremiumBase] [decimal](20, 7) NOT NULL,
	[WorkersCompOvertimeAmount] [decimal](20, 7) NOT NULL,
	[GeneralLiabilityOvertimeAmount] [decimal](20, 7) NOT NULL,
	[WorkersCompExcludableAmount] [decimal](20, 7) NOT NULL,
	[GeneralLiabilityExcludableAmt] [decimal](20, 7) NOT NULL,
	[WorkersCompensationBenefitAmt] [decimal](20, 7) NOT NULL,
	[MonthUpdateofHistory] [int] NOT NULL,
	[DBACode] [int] NOT NULL,
	[SourceofPay] [char](1) NOT NULL,
	[MethodofCalculation] [char](1) NOT NULL,
	[PayClassHSP] [char](1) NOT NULL,
	[EffectonGL] [char](1) NOT NULL,
	[PayFrequency] [char](1) NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[GLPeriodNumber] [int] NOT NULL,
	[DateWorked] [datetime] NOT NULL,
	[DayoftheWeek] [char](1) NOT NULL,
	[DatePayPeriodEnding] [datetime] NOT NULL,
	[PayPeriodoftheMonth] [char](1) NOT NULL,
	[DateTimeClockStartDateandTime] [datetime] NOT NULL,
	[DateTimeClockEnd] [datetime] NOT NULL,
	[CompanyEquipment] [char](5) NOT NULL,
	[EquipmentWorkedOn] [char](9) NOT NULL,
	[EquipmentWorked] [char](9) NOT NULL,
	[EquipmentObjectAccount] [char](6) NOT NULL,
	[EquipmentRateCode] [char](2) NOT NULL,
	[BillingRateEquipment] [decimal](20, 7) NOT NULL,
	[AmountEquipmentGross] [decimal](20, 7) NOT NULL,
	[HoursEquipment] [decimal](20, 7) NOT NULL,
	[RemarkExplaination] [char](30) NOT NULL,
	[Category01CodePayroll] [char](3) NOT NULL,
	[Category01Payroll] [char](30) NOT NULL,
	[Category02CodePayroll] [char](3) NOT NULL,
	[Category02Payroll] [char](30) NOT NULL,
	[Category03CodePayroll] [char](3) NOT NULL,
	[Category03Payroll] [char](30) NOT NULL,
	[Category04CodePayroll] [char](3) NOT NULL,
	[Category04Payroll] [char](30) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[CheckCommentYN] [char](1) NOT NULL,
	[DatePayCheck] [datetime] NOT NULL,
	[AmountUprate] [decimal](20, 7) NOT NULL,
	[RateWorkersCompInsurance] [decimal](20, 7) NOT NULL,
	[RateWorkersCompGenLiability] [decimal](20, 7) NOT NULL,
	[SpendingAccountClaimNumber] [char](15) NOT NULL,
	[GeneralLedgerBatchNumber] [int] NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[ShiftDiffCalcSequence] [char](1) NOT NULL,
	[LaborCostingFlag] [char](1) NOT NULL,
	[PositionID] [char](8) NOT NULL,
	[SickCertificateRequired] [char](1) NOT NULL,
	[SickCertificateReceived] [char](1) NOT NULL,
	[BenefitAccrualType] [char](1) NOT NULL,
	[TimecardFromDate] [datetime] NOT NULL,
	[TimecardThruDate] [datetime] NOT NULL,
	[HoursWorkedPerDay] [decimal](20, 7) NOT NULL,
	[InstanceIdentifier] [char](36) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPYEmployeeTransactionHistory] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[TransactionNoPayroll] ASC,
	[DateWorked] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPYEmployeeTransactionHist] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPYPayCheckHistoryTaxLedger]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPYPayCheckHistoryTaxLedger]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPYPayCheckHistoryTaxLedger](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[PayItemNumber] [int] NOT NULL,
	[CheckControlNumber] [int] NOT NULL,
	[TaxAreaWork] [char](10) NOT NULL,
	[TaxType] [char](2) NOT NULL,
	[StatutoryCode] [char](3) NOT NULL,
	[CompanyEmployeePaidTax] [char](1) NOT NULL,
	[GrossPay01] [decimal](20, 7) NOT NULL,
	[ExcludableGross01] [decimal](20, 7) NOT NULL,
	[WagesInExcess01] [decimal](20, 7) NOT NULL,
	[Tax01] [decimal](20, 7) NOT NULL,
	[MonthUpdateofHistory] [int] NOT NULL,
	[PayPeriodNumber] [char](3) NOT NULL,
	[DatePayPeriodEnding] [datetime] NOT NULL,
	[DateTimeStamp] [datetime] NOT NULL,
	[DatePayCheck] [datetime] NOT NULL,
	[CompanyHome] [char](5) NOT NULL,
	[CodeTaxHistoryType] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPYPayCheckHistoryTaxLedger] PRIMARY KEY CLUSTERED 
(
	[AddressNumber] ASC,
	[CheckControlNumber] ASC,
	[TaxAreaWork] ASC,
	[TaxType] ASC,
	[CodeTaxHistoryType] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPYPayCheckHistoryTaxLedger] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEPYPayrollTransactionConst]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEPYPayrollTransactionConst]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEPYPayrollTransactionConst](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[AddressNumberProviderTrustee] [int] NOT NULL,
	[ExplanationDescription] [char](30) NOT NULL,
	[DescriptionCompressed] [char](40) NOT NULL,
	[DeductBenefitOverrideCode] [char](2) NOT NULL,
	[EffectonGrossPay] [char](1) NOT NULL,
	[EffectonNetPay] [char](1) NOT NULL,
	[TableCode] [char](5) NOT NULL,
	[W2IRSDefinedCode] [char](2) NOT NULL,
	[SourceofPay] [char](1) NOT NULL,
	[SourceofCalculation] [char](1) NOT NULL,
	[EffectonDisposableWage] [char](1) NOT NULL,
	[DBAType] [char](1) NOT NULL,
	[DBACode] [int] NOT NULL,
	[MethodofPrinting] [char](1) NOT NULL,
	[MethodofCalculation] [char](1) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[AmountorRate] [decimal](20, 7) NOT NULL,
	[MultiplierPayTypeMultiplier] [decimal](20, 7) NOT NULL,
	[AmountShiftDifferential] [decimal](20, 7) NOT NULL,
	[ShiftDiffCalcSequence] [char](1) NOT NULL,
	[LimitonPayPeriodDollars] [decimal](20, 7) NOT NULL,
	[LimitonMonthlyDollars] [decimal](20, 7) NOT NULL,
	[LimitonAnnualDollars] [decimal](20, 7) NOT NULL,
	[LimitonPayPeriodPercent] [decimal](20, 7) NOT NULL,
	[NumberofDeductionPeriods] [int] NOT NULL,
	[AmountDue] [decimal](20, 7) NOT NULL,
	[AvailableDBA] [char](1) NOT NULL,
	[TypeSales] [char](1) NOT NULL,
	[HoursMinimum] [decimal](20, 7) NOT NULL,
	[HoursMaximum] [decimal](20, 7) NOT NULL,
	[AutoPayMethods] [char](1) NOT NULL,
	[DeductionPeriod1] [char](1) NOT NULL,
	[DeductionPeriod2] [char](1) NOT NULL,
	[DeductionPeriod3] [char](1) NOT NULL,
	[DeductionPeriod4] [char](1) NOT NULL,
	[DeductionPeriod5] [char](1) NOT NULL,
	[DeductionPeriod6] [char](1) NOT NULL,
	[NonTaxableAuthorityTypes01] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes02] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes03] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes04] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes05] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes06] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes07] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes08] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes09] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes10] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes11] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes12] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes13] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes14] [char](2) NOT NULL,
	[NonTaxableAuthorityTypes15] [char](2) NOT NULL,
	[EffectonGL] [char](1) NOT NULL,
	[DBAForPriorLimit] [int] NOT NULL,
	[OrderToAdjustDed] [int] NOT NULL,
	[GroupLimitCode] [char](2) NOT NULL,
	[DecliningBalanceYN] [char](1) NOT NULL,
	[ArrearageMethod] [char](1) NOT NULL,
	[NumberofDeductionPeriodsUsed] [char](1) NOT NULL,
	[DateService] [datetime] NOT NULL,
	[LimitonQuarterlyDollars] [decimal](20, 7) NOT NULL,
	[BenefitAccrualType] [char](1) NOT NULL,
	[VacationFactor] [char](1) NOT NULL,
	[PayTypeCategory] [char](1) NOT NULL,
	[COBRAPlan] [int] NOT NULL,
	[StartEffectiveDate] [datetime] NOT NULL,
	[DateEndingEffective] [datetime] NOT NULL,
	[AccrualEquivalent] [int] NOT NULL,
	[LimitonAnnualDollarsLevel2] [decimal](20, 7) NOT NULL,
	[DeductionNumberSubsequent] [int] NOT NULL,
	[AmountorRateSecondary] [decimal](20, 7) NOT NULL,
	[ReportCodesPRTransaction01] [char](3) NOT NULL,
	[ReportCodesPRTransaction02] [char](3) NOT NULL,
	[ReportCodesPRTransaction03] [char](3) NOT NULL,
	[ReportCodesPRTransaction04] [char](3) NOT NULL,
	[ReportCodesPRTransaction05] [char](3) NOT NULL,
	[LimitMethod] [char](1) NOT NULL,
	[CalcForAllEmpYN] [char](1) NOT NULL,
	[PayClassHSP] [char](1) NOT NULL,
	[AmountCoverage] [decimal](20, 7) NOT NULL,
	[TransCodeIdentifier] [char](2) NOT NULL,
	[TransCodeStatusCode] [char](1) NOT NULL,
	[TransCodeBeneficiaryFlag] [char](1) NOT NULL,
	[LimitonPayPeriodPercentMinimum] [decimal](20, 7) NOT NULL,
	[WhenToAdjustDed] [char](1) NOT NULL,
	[CanadianEIAllocationFlag] [char](1) NOT NULL,
	[BenefitDeductionTableSecondary] [char](5) NOT NULL,
	[InceptiontoDateLimit] [decimal](20, 7) NOT NULL,
	[RolloverTable] [char](5) NOT NULL,
	[TaxAreaWork] [char](10) NOT NULL,
	[CompanyHome] [char](5) NOT NULL,
	[PgmCall1] [char](10) NOT NULL,
	[PgmCall2] [char](10) NOT NULL,
	[CodeTaxAreaDeduction] [char](1) NOT NULL,
	[CalendarMonthMethod] [char](1) NOT NULL,
	[BasedFrom] [char](4) NOT NULL,
	[CalcOncePerPeriod] [char](1) NOT NULL,
	[IncludeinUnionPlanYN] [char](1) NOT NULL,
	[InvestmentGroupCodes] [char](1) NOT NULL,
	[ReportCodesPRTransaction06] [char](3) NOT NULL,
	[ReportCodesPRTransaction07] [char](3) NOT NULL,
	[ReportCodesPRTransaction08] [char](3) NOT NULL,
	[ReportCodesPRTransaction09] [char](3) NOT NULL,
	[ReportCodesPRTransaction10] [char](3) NOT NULL,
	[ReportCodesPRTransaction11] [char](3) NOT NULL,
	[ReportCodesPRTransaction12] [char](3) NOT NULL,
	[ReportCodesPRTransaction13] [char](3) NOT NULL,
	[ReportCodesPRTransaction14] [char](3) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ReportCodesPRTransaction15] [char](3) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[ReportCodesPRTransaction16] [char](3) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[ReportCodesPRTransaction17] [char](3) NOT NULL,
	[ReportCodesPRTransaction18] [char](3) NOT NULL,
	[ReportCodesPRTransaction19] [char](3) NOT NULL,
	[ReportCodesPRTransaction20] [char](3) NOT NULL,
	[OptionalDBAProcessingFlag] [char](1) NOT NULL,
	[SpendingAccountType] [char](3) NOT NULL,
	[CalculateIfNoGrossYN] [char](1) NOT NULL,
	[CalcinPrePayrollYN] [char](1) NOT NULL,
	[APVoucherYN] [char](1) NOT NULL,
	[PreTaxDeduction] [char](3) NOT NULL,
	[X415TestingCode] [char](3) NOT NULL,
	[CalculateDuringInterimProces] [char](1) NOT NULL,
	[TypeofRolloverYear] [char](1) NOT NULL,
	[AnniversaryFiscalBeginningDate] [char](4) NOT NULL,
	[W2SpecialHandlingDescription] [char](4) NOT NULL,
	[EffectonCheck] [char](1) NOT NULL,
	[AnniversaryProrationRule] [char](1) NOT NULL,
	[DateEffectiveRateControl] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEPYPayrollTransactionConstants] PRIMARY KEY CLUSTERED 
(
	[DBACode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEPYPayrollTransactionConst] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDESecUserRoles]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDESecUserRoles]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDESecUserRoles](
	[FromRole] [char](15) NOT NULL,
	[ToRole] [char](15) NOT NULL,
	[EffectiveDate] [datetime] NOT NULL,
	[ExpirationDate] [datetime] NOT NULL,
	[RoleType] [char](1) NOT NULL,
	[SystemRole] [char](1) NOT NULL,
	[DefaultRole] [char](1) NOT NULL,
	[FutureUseRole1] [char](1) NOT NULL,
	[FutureUseRole2] [char](1) NOT NULL,
	[FutureUseRole3] [char](1) NOT NULL,
	[FutureUseRole4] [char](1) NOT NULL,
	[FutureUseRole5] [char](1) NOT NULL,
	[FutureUseRole6] [char](1) NOT NULL,
	[FutureUseRole7] [char](1) NOT NULL,
	[FutureUseRole8] [char](1) NOT NULL,
	[FutureUseRole9] [char](1) NOT NULL,
	[FutureUseRole10] [char](1) NOT NULL,
	[FutureUseRole11] [char](1) NOT NULL,
	[FutureUseRole12] [char](1) NOT NULL,
	[FutureUseRole13] [char](1) NOT NULL,
	[FutureUseRole14] [char](1) NOT NULL,
	[FutureUseRole15] [char](1) NOT NULL,
	[FutureUseRole16] [char](1) NOT NULL,
	[FutureUseRole17] [char](1) NOT NULL,
	[FutureUseRole18] [char](1) NOT NULL,
	[FutureUseRole19] [char](1) NOT NULL,
	[FutureUseRole20] [char](1) NOT NULL,
	[FutureUseRole22] [char](10) NOT NULL,
	[FutureUseRole23] [char](40) NOT NULL,
	[FutureUseRole24] [decimal](28, 7) NOT NULL,
	[FutureUseRole25] [decimal](28, 7) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramId] [char](10) NOT NULL,
	[WorkStationId] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeLastUpdated] [numeric](6, 0) NOT NULL,
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
 CONSTRAINT [PK_JDESecUserRoles] PRIMARY KEY CLUSTERED 
(
	[FromRole] ASC,
	[ToRole] ASC,
	[EffectiveDate] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDESecUserRoles] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDESFControlRoutingInstruct]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDESFControlRoutingInstruct]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDESFControlRoutingInstruct](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[TypeofRouting] [char](3) NOT NULL,
	[ParentItemNumber] [int] NOT NULL,
	[ItemNumber2ndKit] [char](25) NOT NULL,
	[ItemNumber3rdKit] [char](25) NOT NULL,
	[Branch] [char](12) NOT NULL,
	[LineCellIdentifier] [char](12) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[AutoLoadDescription] [char](4) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[OperationsSequenceNumber] [decimal](20, 7) NOT NULL,
	[TypeOperationCode] [char](2) NOT NULL,
	[OperationStatusCodeWO] [char](2) NOT NULL,
	[InspectionCode] [char](2) NOT NULL,
	[TimeBasis] [char](1) NOT NULL,
	[LabororMachine] [char](1) NOT NULL,
	[PayPointCode] [char](1) NOT NULL,
	[PayPointStatus] [char](1) NOT NULL,
	[JobType] [char](6) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[CriticalRatio] [decimal](20, 7) NOT NULL,
	[SlackTimeRatio] [decimal](20, 7) NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[DateStartJulian] [datetime] NOT NULL,
	[DateCompletionJulian] [datetime] NOT NULL,
	[TimeBeginningHHMMSS] [int] NOT NULL,
	[TimeEndingHHMMSS] [int] NOT NULL,
	[ShiftCodeRequested] [char](1) NOT NULL,
	[ShiftCodeStart] [char](1) NOT NULL,
	[ShiftCodeCompleted] [char](1) NOT NULL,
	[PercentLeadtimeOverlap] [decimal](20, 7) NOT NULL,
	[PercentOverlap] [decimal](20, 7) NOT NULL,
	[PercentOperationalPlannedYield] [decimal](20, 7) NOT NULL,
	[PercentCumulativePlannedYield] [decimal](20, 7) NOT NULL,
	[SequenceNumberNextOperation] [decimal](20, 7) NOT NULL,
	[CrewSize] [decimal](20, 7) NOT NULL,
	[MoveHours] [decimal](20, 7) NOT NULL,
	[QueueHours] [decimal](20, 7) NOT NULL,
	[RunMachineStandard] [decimal](20, 7) NOT NULL,
	[RunLaborStandard] [decimal](20, 7) NOT NULL,
	[StandardSetupHours] [decimal](20, 7) NOT NULL,
	[RunMachineActual] [decimal](20, 7) NOT NULL,
	[RunLaborActual] [decimal](20, 7) NOT NULL,
	[HoursSetupLaborHoursActual] [decimal](20, 7) NOT NULL,
	[FactorOperationShrinkageFactor] [decimal](20, 7) NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[QuantityCanceled] [decimal](22, 7) NOT NULL,
	[QuantityShipped] [decimal](22, 7) NOT NULL,
	[UnitsQuantityatOperation] [decimal](22, 7) NOT NULL,
	[RatePiecework] [decimal](20, 7) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[HoursUnaccountedDirectLabor] [decimal](20, 7) NOT NULL,
	[HoursUnaccountedSetupLabor] [decimal](20, 7) NOT NULL,
	[HoursUnaccountedMachineHours] [decimal](20, 7) NOT NULL,
	[AmountUnaccountedDirectLabor] [decimal](20, 7) NOT NULL,
	[AmountUnaccountedSetupLabor] [decimal](20, 7) NOT NULL,
	[AmountUnaccountedMachine] [decimal](20, 7) NOT NULL,
	[UnitorTagNumber] [char](12) NOT NULL,
	[MessageNumber] [char](10) NOT NULL,
	[PurchasingBusinessUnit] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[RelatedPOSOLineNumber] [decimal](20, 7) NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[Location] [char](20) NOT NULL,
	[Resourceunitsconsumed] [decimal](20, 7) NOT NULL,
	[CapacityUnitofmeasure] [char](2) NOT NULL,
	[WorkcenterBranch] [char](12) NOT NULL,
	[RunMachineCurrent] [decimal](20, 7) NOT NULL,
	[RunLaborCurrent] [decimal](20, 7) NOT NULL,
	[SetupLaborCurrent] [decimal](20, 7) NOT NULL,
	[CostComponent] [char](3) NOT NULL,
	[ActivityBasedCostingActCode] [char](10) NOT NULL,
	[AssetItemNumber] [decimal](20, 7) NOT NULL,
	[AmountUnaccountedScrap] [decimal](20, 7) NOT NULL,
	[UnitsUnaccountedScrap] [decimal](22, 7) NOT NULL,
	[HoursUnaccountedDirectLaborS9] [decimal](20, 7) NOT NULL,
	[RunLaborRate] [decimal](20, 7) NOT NULL,
	[RunMachineRate] [decimal](20, 7) NOT NULL,
	[SetupLaborRate] [decimal](20, 7) NOT NULL,
	[ConstraintsFlag] [char](1) NOT NULL,
	[TimeScheduledStartHHMMSS] [int] NOT NULL,
	[TimeScheduledEndHHMMSS] [int] NOT NULL,
	[TimeCompleted] [int] NOT NULL,
	[DateActualStart] [datetime] NOT NULL,
	[TimeStartHHMMSS] [int] NOT NULL,
	[CompetencyType] [char](3) NOT NULL,
	[CompetencyCode] [char](10) NOT NULL,
	[CompetencyLevelFrom] [decimal](20, 7) NOT NULL,
	[CompetencyLevelTo] [decimal](20, 7) NOT NULL,
	[RuleMatchFlag] [char](1) NOT NULL,
	[AddressNumberManager] [int] NOT NULL,
	[Supervisor] [int] NOT NULL,
	[AddressNumberAssignedTo] [int] NOT NULL,
	[MaintenanceScheduleFlag] [char](1) NOT NULL,
	[ResourcesAssigned] [char](1) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDESFShopFloorControlRoutingInstructions] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[BusinessUnitCode] ASC,
	[OperationsSequenceNumber] ASC,
	[TypeOperationCode] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDESFControlRoutingInstruct] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDESFShopFloorControlPartsList]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDESFShopFloorControlPartsList]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDESFShopFloorControlPartsList](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[TypeBillofMaterial] [char](3) NOT NULL,
	[FixedorVariableQuantity] [char](1) NOT NULL,
	[IssueTypeCode] [char](1) NOT NULL,
	[CoProductByProductIntermediate] [char](1) NOT NULL,
	[ComponentType] [char](1) NOT NULL,
	[ComponentLineNumber] [decimal](20, 7) NOT NULL,
	[FromPotency] [decimal](20, 7) NOT NULL,
	[ThruPotency] [decimal](20, 7) NOT NULL,
	[FromGrade] [char](3) NOT NULL,
	[ThruGrade] [char](3) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[RelatedPOSOLineNumber] [decimal](20, 7) NOT NULL,
	[OperationsSequenceNumber] [decimal](20, 7) NOT NULL,
	[SequenceBubbleSequence] [int] NOT NULL,
	[ResourcePercent] [decimal](20, 7) NOT NULL,
	[PercentPercentofScrap] [decimal](20, 7) NOT NULL,
	[PercentRework] [decimal](20, 7) NOT NULL,
	[PercentAsis] [decimal](20, 7) NOT NULL,
	[PercentCumulativePlannedYield] [decimal](20, 7) NOT NULL,
	[OperationScrapPercent] [decimal](20, 7) NOT NULL,
	[LeadtimeOffsetDays] [int] NOT NULL,
	[ComponentItemNumberShort] [int] NOT NULL,
	[Component2ndItemNumber] [char](25) NOT NULL,
	[Component3rdItemNumber] [char](25) NOT NULL,
	[ComponentBranch] [char](12) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[LineType] [char](2) NOT NULL,
	[LotSerialNumber] [char](30) NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[TimeBeginningHHMMSS] [int] NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[TransactionQuantity] [decimal](22, 7) NOT NULL,
	[QuantityCanceled] [decimal](22, 7) NOT NULL,
	[QuantityBackordered] [decimal](22, 7) NOT NULL,
	[HoursUnaccountedDirectLabor] [decimal](20, 7) NOT NULL,
	[UnitsQuantityCommited] [decimal](15, 0) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[AmountEstimatedCost] [decimal](20, 7) NOT NULL,
	[RouteSheetN] [char](1) NOT NULL,
	[MaterialStatusCodeWO] [char](2) NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[MessageNumber] [char](10) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[PurchasingBusinessUnit] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[ComponentRevisionLevel] [char](3) NOT NULL,
	[DateCompletionJulian] [datetime] NOT NULL,
	[NumberParentWONumber] [char](8) NOT NULL,
	[CommittedHS] [char](1) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[UniqueKeyIDInternal] [decimal](15, 0) NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[IssueandReceipt] [char](1) NOT NULL,
	[AmountUnaccountedDirectLabor] [decimal](20, 7) NOT NULL,
	[AmountUnaccountedScrap] [decimal](20, 7) NOT NULL,
	[UnitsUnaccountedScrap] [decimal](22, 7) NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[PartsListSubstituteFlag] [char](1) NOT NULL,
	[ActiveIngredientFlag] [char](1) NOT NULL,
	[SecondaryQuantityIssuedComp] [decimal](22, 7) NOT NULL,
	[UnitofMeasureSecondary] [char](2) NOT NULL,
	[ConstraintsFlag] [char](1) NOT NULL,
	[PickSlipNumber] [int] NOT NULL,
	[LotEffectivityDate] [datetime] NOT NULL,
	[CostComponent] [char](3) NOT NULL,
	[CriticalHoldPropagation] [char](1) NOT NULL,
	[ComponentLineNumberBOM] [decimal](20, 7) NOT NULL,
	[BubbleSequenceAlphaNumeric] [char](5) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDESFShopFloorControlPartsList] PRIMARY KEY CLUSTERED 
(
	[UniqueKeyIDInternal] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDESFShopFloorControlPartsList] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDESFWOCrossReferenceFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDESFWOCrossReferenceFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDESFWOCrossReferenceFile](
	[SourceID] [int] NOT NULL,
	[Source] [nchar](20) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [nchar](2) NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[BatchNumber] [int] NOT NULL,
	[BatchType] [nchar](2) NOT NULL,
	[BatchDate] [datetime] NOT NULL,
	[UserID] [nchar](10) NOT NULL,
	[ProgramID] [nchar](10) NOT NULL,
	[WorkStationID] [nchar](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDESFWOCrossReferenceFile] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[DocumentNumber] ASC,
	[GLDate] ASC,
	[BatchType] ASC,
	[UserID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[JDESFWOCrossReferenceFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDESOSalesOrderDetail]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderDetail]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDESOSalesOrderDetail](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalOrderNumber] [char](8) NOT NULL,
	[OriginalOrderTypeCode] [char](2) NOT NULL,
	[OriginalLineNumber] [decimal](20, 7) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[RelatedPOSOLineNumber] [decimal](20, 7) NOT NULL,
	[ContractNumber] [char](12) NOT NULL,
	[ContractSupplement] [int] NOT NULL,
	[ContractBalancesUpdated] [char](1) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ShipToNumber] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[PromisedDeliveryDate] [datetime] NOT NULL,
	[OriginalPromisedDate] [datetime] NOT NULL,
	[ActualDeliveryDate] [datetime] NOT NULL,
	[InvoiceDate] [datetime] NOT NULL,
	[CancelDate] [datetime] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[PromisedDelivery] [datetime] NOT NULL,
	[PriceEffectiveDate] [datetime] NOT NULL,
	[ShipDate] [datetime] NOT NULL,
	[FutureUseDate] [datetime] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[Reference2] [char](25) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[FromGrade] [char](3) NOT NULL,
	[ThruGrade] [char](3) NOT NULL,
	[FromPotency] [decimal](20, 7) NOT NULL,
	[ThruPotency] [decimal](20, 7) NOT NULL,
	[DaysBeforeExpiration] [int] NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[LineType] [char](2) NOT NULL,
	[StatusCodeNext] [char](3) NOT NULL,
	[StatusCodeLast] [char](3) NOT NULL,
	[HeaderBusinessUnit] [char](12) NOT NULL,
	[RelatedItemNumber] [char](8) NOT NULL,
	[KitMasterLineNumber] [decimal](20, 7) NOT NULL,
	[ComponentLineNumber] [decimal](20, 7) NOT NULL,
	[RelatedKitComponent] [int] NOT NULL,
	[NumberOfComponentPerParent] [decimal](22, 7) NOT NULL,
	[SalesCategory01Code] [char](3) NOT NULL,
	[SalesCategory02Code] [char](3) NOT NULL,
	[SalesCategory03Code] [char](3) NOT NULL,
	[SalesCategory04Code] [char](3) NOT NULL,
	[SalesCategory05Code] [char](3) NOT NULL,
	[PurchasingCategory01Code] [char](3) NOT NULL,
	[PurchasingCategory02Code] [char](3) NOT NULL,
	[PurchasingCategory03Code] [char](3) NOT NULL,
	[PurchasingCategory04Code] [char](3) NOT NULL,
	[PurchasingCategory05Code] [char](3) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[QuantityShipped] [decimal](22, 7) NOT NULL,
	[QuantityBackordered] [decimal](22, 7) NOT NULL,
	[QuantityCanceled] [decimal](22, 7) NOT NULL,
	[FutureQuantityCommitted] [decimal](22, 7) NOT NULL,
	[QuantityOpen] [decimal](22, 7) NOT NULL,
	[QuantityShippedToDate] [decimal](22, 7) NOT NULL,
	[QuantityRelieved] [decimal](22, 7) NOT NULL,
	[CommittedHS] [char](1) NOT NULL,
	[OtherQuantity] [char](1) NOT NULL,
	[UnitPrice] [decimal](20, 7) NOT NULL,
	[ExtendedPrice] [decimal](20, 7) NOT NULL,
	[AmountOpen] [decimal](20, 7) NOT NULL,
	[PriceOverrideCode] [char](1) NOT NULL,
	[TemporaryPrice] [char](1) NOT NULL,
	[EnteredUOMForUnitPrice] [char](2) NOT NULL,
	[UnitListPrice] [decimal](20, 7) NOT NULL,
	[UnitCost] [decimal](20, 7) NOT NULL,
	[ExtendedCost] [decimal](20, 7) NOT NULL,
	[CostOverrideCode] [char](1) NOT NULL,
	[TransferCost] [decimal](20, 7) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[BasedonDate] [char](1) NOT NULL,
	[TradeDiscount] [decimal](20, 7) NOT NULL,
	[TradeDiscountOld] [decimal](20, 7) NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[ItemPriceGroupCode] [char](8) NOT NULL,
	[PricingCategoryLevel] [char](3) NOT NULL,
	[DiscountFactor] [decimal](20, 7) NOT NULL,
	[DiscFactorTypeDollarOrPercent] [char](1) NOT NULL,
	[DiscountApplicationType] [char](1) NOT NULL,
	[CashDiscountPercent] [decimal](20, 7) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[OriginalDocumentNumber] [int] NOT NULL,
	[OriginalDocumentTypeCode] [char](2) NOT NULL,
	[OriginalDocumentCompany] [char](5) NOT NULL,
	[PickSlipNumber] [int] NOT NULL,
	[DeliveryNumber] [int] NOT NULL,
	[PromotionNumber] [char](8) NOT NULL,
	[DraftNumber] [int] NOT NULL,
	[SalesTaxable] [char](1) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[AssociatedText] [char](1) NOT NULL,
	[PriorityProcessingCode] [char](1) NOT NULL,
	[PrintedCode] [char](1) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[SubstitutesAllowed] [char](1) NOT NULL,
	[PartialShipmentsAllowed] [char](1) NOT NULL,
	[LineOfBusiness] [char](3) NOT NULL,
	[EndUse] [char](3) NOT NULL,
	[DutyStatus] [char](2) NOT NULL,
	[CommodityCode] [char](15) NOT NULL,
	[NatureofTransaction] [char](2) NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[BuyerNumber] [int] NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[ModeOfTransportation] [char](3) NOT NULL,
	[ConditionsOfTransportation] [char](3) NOT NULL,
	[RouteCode] [char](3) NOT NULL,
	[StopCode] [char](3) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[ContainerID] [char](20) NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[ApplyFreightYN] [char](1) NOT NULL,
	[ApplyFreight] [char](1) NOT NULL,
	[FreightCalculated] [char](1) NOT NULL,
	[RateCodeFreightMisc] [char](10) NOT NULL,
	[RateTypeFreightMisc] [char](1) NOT NULL,
	[ShippingCommodityClass] [char](3) NOT NULL,
	[ShippingConditionsCode] [char](3) NOT NULL,
	[LotSerialNumber] [char](30) NOT NULL,
	[UnitOfMeasurePrimary] [char](2) NOT NULL,
	[PrimaryQuantityOrdered] [decimal](22, 7) NOT NULL,
	[UnitOfMeasureSecondary] [char](2) NOT NULL,
	[SecondaryQuantityOrdered] [decimal](22, 7) NOT NULL,
	[UnitOfMeasurePricing] [char](2) NOT NULL,
	[UnitWeight] [decimal](20, 7) NOT NULL,
	[WeightUOM] [char](2) NOT NULL,
	[UnitVolume] [decimal](20, 7) NOT NULL,
	[VolumeUOM] [char](2) NOT NULL,
	[BasketRepriceGroup] [char](8) NOT NULL,
	[OrderRepriceGroup] [char](8) NOT NULL,
	[OrderRepricedIndicator] [char](1) NOT NULL,
	[InventoryCostingMethod] [char](2) NOT NULL,
	[CommitmentMethod] [char](1) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[Century] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[LineStatus] [char](2) NOT NULL,
	[SalesOrderStatus01] [char](1) NOT NULL,
	[SalesOrderStatus02] [char](1) NOT NULL,
	[SalesOrderStatus03] [char](1) NOT NULL,
	[SalesOrderStatus04] [char](1) NOT NULL,
	[SalesOrderStatus05] [char](1) NOT NULL,
	[SalesOrderStatus06] [char](1) NOT NULL,
	[SalesOrderStatus07] [char](1) NOT NULL,
	[SalesOrderStatus08] [char](1) NOT NULL,
	[SalesOrderStatus09] [char](1) NOT NULL,
	[SalesOrderStatus10] [char](1) NOT NULL,
	[SalesOrderStatus11] [char](1) NOT NULL,
	[SalesOrderStatus12] [char](1) NOT NULL,
	[SalesOrderStatus13] [char](1) NOT NULL,
	[SalesOrderStatus14] [char](1) NOT NULL,
	[SalesOrderStatus15] [char](1) NOT NULL,
	[SalespersonCode01] [int] NOT NULL,
	[SalespersonCommission01] [decimal](20, 7) NOT NULL,
	[SalespersonCode02] [int] NOT NULL,
	[SalespersonCommission02] [decimal](20, 7) NOT NULL,
	[ApplyCommission] [char](1) NOT NULL,
	[CommissionCategory] [char](8) NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[GrossWeight] [decimal](20, 7) NOT NULL,
	[GrossWeightUOM] [char](2) NOT NULL,
	[AccountNumber] [char](29) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[PurchasingBusinessUnit] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[LedgerTypeCode] [char](2) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[LocalTaxCode] [char](2) NOT NULL,
	[PriceCode1] [char](2) NOT NULL,
	[PriceCode2] [char](2) NOT NULL,
	[PriceCode3] [char](2) NOT NULL,
	[WarehouseStatusCode] [char](1) NOT NULL,
	[FreezeCode] [char](1) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[ForeignListPrice] [decimal](20, 7) NOT NULL,
	[ForeignUnitPrice] [decimal](20, 7) NOT NULL,
	[ForeignExtendedPrice] [decimal](20, 7) NOT NULL,
	[ForeignUnitCost2] [decimal](20, 7) NOT NULL,
	[ForeignExtendedCost] [decimal](20, 7) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[ManufacturingVarianceAcctFlag] [char](1) NOT NULL,
	[SalesOrderStatus17] [char](1) NOT NULL,
	[SalesOrderStatus18] [char](1) NOT NULL,
	[SalesOrderStatus19] [char](1) NOT NULL,
	[SalesOrderStatus20] [char](1) NOT NULL,
	[IntegrationReference01] [char](30) NOT NULL,
	[IntegrationReference02] [char](30) NOT NULL,
	[IntegrationReference03] [char](30) NOT NULL,
	[IntegrationReference04] [char](30) NOT NULL,
	[IntegrationReference05] [char](30) NOT NULL,
	[SourceofOrder] [int] NOT NULL,
	[Reference] [char](25) NOT NULL,
	[DemandUniqueKeyID] [int] NOT NULL,
	[PullSignal] [char](30) NOT NULL,
	[ReleaseNumber] [char](10) NOT NULL,
	[ScheduledShipmentTime] [int] NOT NULL,
	[TimeRelease] [int] NOT NULL,
	[DateRelease] [datetime] NOT NULL,
	[RequestedDeliveryTime] [int] NOT NULL,
	[ActualShipmentTime] [int] NOT NULL,
	[TimeOriginalPromisedDelivery] [int] NOT NULL,
	[TimeScheduledPick] [int] NOT NULL,
	[TimeFutureTime2] [int] NOT NULL,
	[CrossDockingFlag] [char](1) NOT NULL,
	[CrossDockingPriorityforSalesO] [decimal](28, 0) NOT NULL,
	[DualUnitOfMeasureItem] [char](1) NOT NULL,
	[BuyingSegmentCode] [char](10) NOT NULL,
	[CurrentBuyingSegmentCode] [char](10) NOT NULL,
	[ChangeOrderNumber] [int] NOT NULL,
	[AddressNumberDeliverTo] [int] NOT NULL,
	[PendingApprovalFlag] [char](1) NOT NULL,
	[RevisionReason] [char](6) NOT NULL,
	[MatrixControlLineNumber] [decimal](20, 7) NOT NULL,
	[ShipmentNumber] [int] NOT NULL,
	[PromisedDeliveryTime] [int] NOT NULL,
	[ProjectNumber] [int] NOT NULL,
	[SequenceNumber] [int] NOT NULL,
	[ItemRevisionLevel] [char](3) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[BusinessUnitHeader] [char](12) NOT NULL,
	[BusinessUnitDemand] [char](12) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[DocumentLineNumberOriginal] [decimal](20, 7) NOT NULL,
	[CrossDockOrderCompanyOrderNum] [char](10) NOT NULL,
	[CrossDockOrderNo] [int] NOT NULL,
	[CrossDockOrderType] [char](4) NOT NULL,
	[CrossDockLineNumber] [decimal](20, 7) NOT NULL,
	[CrossDockOrderSuffix] [char](3) NOT NULL,
	[PortofEntryorExit] [char](6) NOT NULL,
	[PaymentTermsOverrideCode] [char](1) NOT NULL,
	[PromotionID] [char](12) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[ParentNumberAAID] [int] NOT NULL,
	[ShipToAttention] [char](50) NOT NULL,
	[PartnerAddressNumber] [int] NOT NULL,
	[PartnerContactLineNumberID] [int] NOT NULL,
	[CustomerContactLineNumberID] [int] NOT NULL,
	[ShipToCustContactLineNumID] [int] NOT NULL,
	[OpportunityNumber] [int] NOT NULL,
	[OrganizationStructureType] [char](3) NOT NULL,
	[UniqueKeyIDInternal] [int] NOT NULL,
	[CatalogName] [char](30) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDESOSalesOrderDetail] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[OrderNumberDocumentCompany] ASC,
	[LineNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderSuffix] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDESOSalesOrderDetail] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDESOSalesOrderDetailHistory]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderDetailHistory]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDESOSalesOrderDetailHistory](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalOrderNumber] [char](8) NOT NULL,
	[OriginalOrderTypeCode] [char](2) NOT NULL,
	[OriginalLineNumber] [decimal](20, 7) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[RelatedPOSOLineNumber] [decimal](20, 7) NOT NULL,
	[ContractNumber] [char](12) NOT NULL,
	[ContractSupplement] [int] NOT NULL,
	[ContractBalancesUpdated] [char](1) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ShipToNumber] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[PromisedDeliveryDate] [datetime] NOT NULL,
	[OriginalPromisedDate] [datetime] NOT NULL,
	[ActualDeliveryDate] [datetime] NOT NULL,
	[InvoiceDate] [datetime] NOT NULL,
	[CancelDate] [datetime] NOT NULL,
	[GLDate] [datetime] NOT NULL,
	[PromisedDelivery] [datetime] NOT NULL,
	[PriceEffectiveDate] [datetime] NOT NULL,
	[ShipDate] [datetime] NOT NULL,
	[FutureUseDate] [datetime] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[Reference2] [char](25) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[Location] [char](20) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[FromGrade] [char](3) NOT NULL,
	[ThruGrade] [char](3) NOT NULL,
	[FromPotency] [decimal](20, 7) NOT NULL,
	[ThruPotency] [decimal](20, 7) NOT NULL,
	[DaysBeforeExpiration] [int] NOT NULL,
	[Description01] [char](30) NOT NULL,
	[Description02] [char](30) NOT NULL,
	[LineType] [char](2) NOT NULL,
	[StatusCodeNext] [char](3) NOT NULL,
	[StatusCodeLast] [char](3) NOT NULL,
	[HeaderBusinessUnit] [char](12) NOT NULL,
	[RelatedItemNumber] [char](8) NOT NULL,
	[KitMasterLineNumber] [decimal](20, 7) NOT NULL,
	[ComponentLineNumber] [decimal](20, 7) NOT NULL,
	[RelatedKitComponent] [int] NOT NULL,
	[NumberOfComponentPerParent] [decimal](22, 7) NOT NULL,
	[SalesCategory01Code] [char](3) NOT NULL,
	[SalesCategory02Code] [char](3) NOT NULL,
	[SalesCategory03Code] [char](3) NOT NULL,
	[SalesCategory04Code] [char](3) NOT NULL,
	[SalesCategory05Code] [char](3) NOT NULL,
	[PurchasingCategory01Code] [char](3) NOT NULL,
	[PurchasingCategory02Code] [char](3) NOT NULL,
	[PurchasingCategory03Code] [char](3) NOT NULL,
	[PurchasingCategory04Code] [char](3) NOT NULL,
	[PurchasingCategory05Code] [char](3) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[QuantityShipped] [decimal](22, 7) NOT NULL,
	[QuantityBackordered] [decimal](22, 7) NOT NULL,
	[QuantityCanceled] [decimal](22, 7) NOT NULL,
	[FutureQuantityCommitted] [decimal](22, 7) NOT NULL,
	[QuantityOpen] [decimal](22, 7) NOT NULL,
	[QuantityShippedToDate] [decimal](22, 7) NOT NULL,
	[QuantityRelieved] [decimal](22, 7) NOT NULL,
	[CommittedHS] [char](1) NOT NULL,
	[OtherQuantity] [char](1) NOT NULL,
	[UnitPrice] [decimal](20, 7) NOT NULL,
	[ExtendedPrice] [decimal](20, 7) NOT NULL,
	[AmountOpen] [decimal](20, 7) NOT NULL,
	[PriceOverrideCode] [char](1) NOT NULL,
	[TemporaryPrice] [char](1) NOT NULL,
	[EnteredUOMForUnitPrice] [char](2) NOT NULL,
	[UnitListPrice] [decimal](20, 7) NOT NULL,
	[UnitCost] [decimal](20, 7) NOT NULL,
	[ExtendedCost] [decimal](20, 7) NOT NULL,
	[CostOverrideCode] [char](1) NOT NULL,
	[TransferCost] [decimal](20, 7) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[BasedonDate] [char](1) NOT NULL,
	[TradeDiscount] [decimal](20, 7) NOT NULL,
	[TradeDiscountOld] [decimal](20, 7) NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[ItemPriceGroupCode] [char](8) NOT NULL,
	[PricingCategoryLevel] [char](3) NOT NULL,
	[DiscountFactor] [decimal](20, 7) NOT NULL,
	[DiscFactorTypeDollarOrPercent] [char](1) NOT NULL,
	[DiscountApplicationType] [char](1) NOT NULL,
	[CashDiscountPercent] [decimal](20, 7) NOT NULL,
	[DocumentCompany] [char](5) NOT NULL,
	[DocumentNumber] [int] NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[OriginalDocumentNumber] [int] NOT NULL,
	[OriginalDocumentTypeCode] [char](2) NOT NULL,
	[OriginalDocumentCompany] [char](5) NOT NULL,
	[PickSlipNumber] [int] NOT NULL,
	[DeliveryNumber] [int] NOT NULL,
	[PromotionNumber] [char](8) NOT NULL,
	[DraftNumber] [int] NOT NULL,
	[SalesTaxable] [char](1) NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[AssociatedText] [char](1) NOT NULL,
	[PriorityProcessingCode] [char](1) NOT NULL,
	[PrintedCode] [char](1) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[SubstitutesAllowed] [char](1) NOT NULL,
	[PartialShipmentsAllowed] [char](1) NOT NULL,
	[LineOfBusiness] [char](3) NOT NULL,
	[EndUse] [char](3) NOT NULL,
	[DutyStatus] [char](2) NOT NULL,
	[CommodityCode] [char](15) NOT NULL,
	[NatureofTransaction] [char](2) NOT NULL,
	[PrimaryLastSupplierNumber] [int] NOT NULL,
	[BuyerNumber] [int] NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[ModeOfTransportation] [char](3) NOT NULL,
	[ConditionsOfTransportation] [char](3) NOT NULL,
	[RouteCode] [char](3) NOT NULL,
	[StopCode] [char](3) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[ContainerID] [char](20) NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[ApplyFreightYN] [char](1) NOT NULL,
	[ApplyFreight] [char](1) NOT NULL,
	[FreightCalculated] [char](1) NOT NULL,
	[RateCodeFreightMisc] [char](10) NOT NULL,
	[RateTypeFreightMisc] [char](1) NOT NULL,
	[ShippingCommodityClass] [char](3) NOT NULL,
	[ShippingConditionsCode] [char](3) NOT NULL,
	[LotSerialNumber] [char](30) NOT NULL,
	[UnitOfMeasurePrimary] [char](2) NOT NULL,
	[PrimaryQuantityOrdered] [decimal](22, 7) NOT NULL,
	[UnitOfMeasureSecondary] [char](2) NOT NULL,
	[SecondaryQuantityOrdered] [decimal](22, 7) NOT NULL,
	[UnitOfMeasurePricing] [char](2) NOT NULL,
	[UnitWeight] [decimal](20, 7) NOT NULL,
	[WeightUOM] [char](2) NOT NULL,
	[UnitVolume] [decimal](20, 7) NOT NULL,
	[VolumeUOM] [char](2) NOT NULL,
	[BasketRepriceGroup] [char](8) NOT NULL,
	[OrderRepriceGroup] [char](8) NOT NULL,
	[OrderRepricedIndicator] [char](1) NOT NULL,
	[InventoryCostingMethod] [char](2) NOT NULL,
	[CommitmentMethod] [char](1) NOT NULL,
	[GLOffset] [char](4) NOT NULL,
	[Century] [int] NOT NULL,
	[FiscalYear] [int] NOT NULL,
	[LineStatus] [char](2) NOT NULL,
	[SalesOrderStatus01] [char](1) NOT NULL,
	[SalesOrderStatus02] [char](1) NOT NULL,
	[SalesOrderStatus03] [char](1) NOT NULL,
	[SalesOrderStatus04] [char](1) NOT NULL,
	[SalesOrderStatus05] [char](1) NOT NULL,
	[SalesOrderStatus06] [char](1) NOT NULL,
	[SalesOrderStatus07] [char](1) NOT NULL,
	[SalesOrderStatus08] [char](1) NOT NULL,
	[SalesOrderStatus09] [char](1) NOT NULL,
	[SalesOrderStatus10] [char](1) NOT NULL,
	[SalesOrderStatus11] [char](1) NOT NULL,
	[SalesOrderStatus12] [char](1) NOT NULL,
	[SalesOrderStatus13] [char](1) NOT NULL,
	[SalesOrderStatus14] [char](1) NOT NULL,
	[SalesOrderStatus15] [char](1) NOT NULL,
	[SalespersonCode01] [int] NOT NULL,
	[SalespersonCommission01] [decimal](20, 7) NOT NULL,
	[SalespersonCode02] [int] NOT NULL,
	[SalespersonCommission02] [decimal](20, 7) NOT NULL,
	[ApplyCommission] [char](1) NOT NULL,
	[CommissionCategory] [char](8) NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[GrossWeight] [decimal](20, 7) NOT NULL,
	[GrossWeightUOM] [char](2) NOT NULL,
	[AccountNumber] [char](29) NOT NULL,
	[AccountID] [char](8) NOT NULL,
	[PurchasingBusinessUnit] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[LedgerTypeCode] [char](2) NOT NULL,
	[SubLedger] [char](8) NOT NULL,
	[SubledgerType] [char](1) NOT NULL,
	[LocalTaxCode] [char](2) NOT NULL,
	[PriceCode1] [char](2) NOT NULL,
	[PriceCode2] [char](2) NOT NULL,
	[PriceCode3] [char](2) NOT NULL,
	[WarehouseStatusCode] [char](1) NOT NULL,
	[FreezeCode] [char](1) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[ForeignListPrice] [decimal](20, 7) NOT NULL,
	[ForeignUnitPrice] [decimal](20, 7) NOT NULL,
	[ForeignExtendedPrice] [decimal](20, 7) NOT NULL,
	[ForeignUnitCost2] [decimal](20, 7) NOT NULL,
	[ForeignExtendedCost] [decimal](20, 7) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[TransactionOriginator] [char](10) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[ManufacturingVarianceAcctFlag] [char](1) NOT NULL,
	[SalesOrderStatus17] [char](1) NOT NULL,
	[SalesOrderStatus18] [char](1) NOT NULL,
	[SalesOrderStatus19] [char](1) NOT NULL,
	[SalesOrderStatus20] [char](1) NOT NULL,
	[IntegrationReference01] [char](30) NOT NULL,
	[IntegrationReference02] [char](30) NOT NULL,
	[IntegrationReference03] [char](30) NOT NULL,
	[IntegrationReference04] [char](30) NOT NULL,
	[IntegrationReference05] [char](30) NOT NULL,
	[SourceofOrder] [int] NOT NULL,
	[Reference] [char](25) NOT NULL,
	[DemandUniqueKeyID] [int] NOT NULL,
	[PullSignal] [char](30) NOT NULL,
	[ReleaseNumber] [char](10) NOT NULL,
	[ScheduledShipmentTime] [int] NOT NULL,
	[TimeRelease] [int] NOT NULL,
	[DateRelease] [datetime] NOT NULL,
	[RequestedDeliveryTime] [int] NOT NULL,
	[ActualShipmentTime] [int] NOT NULL,
	[TimeOriginalPromisedDelivery] [int] NOT NULL,
	[TimeScheduledPick] [int] NOT NULL,
	[TimeFutureTime2] [int] NOT NULL,
	[CrossDockingFlag] [char](1) NOT NULL,
	[CrossDockingPriorityforSalesO] [decimal](28, 0) NOT NULL,
	[DualUnitOfMeasureItem] [char](1) NOT NULL,
	[BuyingSegmentCode] [char](10) NOT NULL,
	[CurrentBuyingSegmentCode] [char](10) NOT NULL,
	[ChangeOrderNumber] [int] NOT NULL,
	[AddressNumberDeliverTo] [int] NOT NULL,
	[PendingApprovalFlag] [char](1) NOT NULL,
	[RevisionReason] [char](6) NOT NULL,
	[MatrixControlLineNumber] [decimal](20, 7) NOT NULL,
	[ShipmentNumber] [int] NOT NULL,
	[PromisedDeliveryTime] [int] NOT NULL,
	[ProjectNumber] [int] NOT NULL,
	[SequenceNumber] [int] NOT NULL,
	[ItemRevisionLevel] [char](3) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[BusinessUnitHeader] [char](12) NOT NULL,
	[BusinessUnitDemand] [char](12) NOT NULL,
	[CurrencyCodeBase] [char](3) NOT NULL,
	[DocumentLineNumberOriginal] [decimal](20, 7) NOT NULL,
	[CrossDockOrderCompanyOrderNum] [char](10) NOT NULL,
	[CrossDockOrderNo] [int] NOT NULL,
	[CrossDockOrderType] [char](4) NOT NULL,
	[CrossDockLineNumber] [decimal](20, 7) NOT NULL,
	[CrossDockOrderSuffix] [char](3) NOT NULL,
	[PortofEntryorExit] [char](6) NOT NULL,
	[PaymentTermsOverrideCode] [char](1) NOT NULL,
	[PromotionID] [char](12) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[ParentNumberAAID] [int] NOT NULL,
	[ShipToAttention] [char](50) NOT NULL,
	[PartnerAddressNumber] [int] NOT NULL,
	[PartnerContactLineNumberID] [int] NOT NULL,
	[CustomerContactLineNumberID] [int] NOT NULL,
	[ShipToCustContactLineNumID] [int] NOT NULL,
	[OpportunityNumber] [int] NOT NULL,
	[OrganizationStructureType] [char](3) NOT NULL,
	[UniqueKeyIDInternal] [int] NOT NULL,
	[CatalogName] [char](30) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDESOSalesOrderDetailHistory] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[OrderNumberDocumentCompany] ASC,
	[LineNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderSuffix] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDESOSalesOrderDetailHistory] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDESOSalesOrderHeader]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderHeader]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDESOSalesOrderHeader](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalOrderNumber] [char](8) NOT NULL,
	[OriginalOrderTypeCode] [char](2) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ShipTo] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[PromisedDeliveryDate] [datetime] NOT NULL,
	[OriginalPromisedDate] [datetime] NOT NULL,
	[ActualDeliveryDate] [datetime] NOT NULL,
	[CancelDate] [datetime] NOT NULL,
	[PriceEffectiveDate] [datetime] NOT NULL,
	[ShipDate] [datetime] NOT NULL,
	[FutureUseDate] [datetime] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[Reference2] [char](25) NOT NULL,
	[DeliveryInstructions01] [char](30) NOT NULL,
	[DeliveryInstructions02] [char](30) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[PricingGroup] [char](8) NOT NULL,
	[TradeDiscount] [decimal](20, 7) NOT NULL,
	[RetainagePercent] [int] NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[Certificate] [char](20) NOT NULL,
	[AssociatedText] [char](1) NOT NULL,
	[PriorityProcessingCode] [char](1) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[SubstitutesAllowed] [char](1) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[PricePickList] [char](1) NOT NULL,
	[InvoiceCopies] [int] NOT NULL,
	[NatureofTransaction] [char](2) NOT NULL,
	[BuyerNumber] [int] NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[ModeOfTransportation] [char](3) NOT NULL,
	[ConditionsOfTransportation] [char](3) NOT NULL,
	[RouteCode] [char](3) NOT NULL,
	[StopCode] [char](3) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[ContainerID] [char](20) NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[ApplyFreightYN] [char](1) NOT NULL,
	[ApplyFreight] [char](1) NOT NULL,
	[FreightCalculated] [char](1) NOT NULL,
	[MergeOrders] [char](1) NOT NULL,
	[CommissionCode01] [int] NOT NULL,
	[CommissionRate1] [decimal](20, 7) NOT NULL,
	[CommissionCode02] [int] NOT NULL,
	[CommissionRate2] [decimal](20, 7) NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[PostQuantities] [char](1) NOT NULL,
	[OrderGrossAmount] [decimal](20, 7) NOT NULL,
	[TotalCost] [decimal](20, 7) NOT NULL,
	[WeightDisplayedUOM] [char](2) NOT NULL,
	[VolumeDisplayedUOM] [char](2) NOT NULL,
	[AuthorizationNumCreditApproval] [char](10) NOT NULL,
	[CreditBankAccountNumber] [char](25) NOT NULL,
	[ExpiredDateCreditBankAccount] [datetime] NOT NULL,
	[SubledgerInactiveCode] [char](1) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[LanguagePreferenceCode] [char](2) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[ForeignTotalCost] [decimal](20, 7) NOT NULL,
	[OrderedBy] [char](10) NOT NULL,
	[OrderTakenBy] [char](10) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [decimal](18, 0) NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[IntegrationReference01] [char](60) NOT NULL,
	[IntegrationReference02] [char](60) NOT NULL,
	[IntegrationReference03] [char](60) NOT NULL,
	[IntegrationReference04] [char](60) NOT NULL,
	[IntegrationReference05] [char](60) NOT NULL,
	[Reference] [char](50) NOT NULL,
	[SourceofOrder] [int] NOT NULL,
	[ScheduledShipmentTime] [int] NOT NULL,
	[PromisedDeliveryTime] [int] NOT NULL,
	[DateRequestedShip] [datetime] NOT NULL,
	[TimeFutureTime2] [int] NOT NULL,
	[TimeScheduledPick] [int] NOT NULL,
	[TimeOriginalPromisedDelivery] [int] NOT NULL,
	[RequestedDeliveryTime] [int] NOT NULL,
	[ActualShipmentTime] [int] NOT NULL,
	[DateActualDelivery] [datetime] NOT NULL,
	[AddressNumbePaidBy] [int] NOT NULL,
	[AddressNumberInvoicedTo] [int] NOT NULL,
	[AddressNumberForwardedTo] [int] NOT NULL,
	[AddressNumberDeliverTo] [int] NOT NULL,
	[DocumentOrderInvoiceetc] [int] NOT NULL,
	[DocumentType] [char](60) NOT NULL,
	[ChangeOrderNumber] [int] NOT NULL,
	[BuyingSegmentCode] [char](20) NOT NULL,
	[CurrencyCodeBase] [char](6) NOT NULL,
	[AddressNumbertouseforTax] [char](2) NOT NULL,
	[AddressNumberTransportation] [char](2) NOT NULL,
	[OPBusinessObjective] [char](60) NOT NULL,
	[OPTotalCost] [int] NOT NULL,
	[OPLatestLineDate] [datetime] NOT NULL,
	[OPNumberofBackorders] [int] NOT NULL,
	[OPNumberofSubstitutes] [int] NOT NULL,
	[OPPromisedStatus] [char](60) NOT NULL,
	[OPPartialOrderShipment] [char](60) NOT NULL,
	[OPAllowMultiSource] [char](2) NOT NULL,
	[OPAllowSubstitutes] [char](2) NOT NULL,
	[OPAllowBackorders] [char](2) NOT NULL,
	[OPPartialShipLineItems] [char](2) NOT NULL,
	[PartnerAddressNumber] [int] NOT NULL,
	[OpportunityNumber] [int] NOT NULL,
	[SoldToAttention] [char](50) NOT NULL,
	[ShipToAttention] [char](50) NOT NULL,
	[OrderTypeIndicator] [char](1) NOT NULL,
	[PartnerContactLineNumberID] [int] NOT NULL,
	[CustomerContactLineNumberID] [int] NOT NULL,
	[ShipToCustContactLineNumID] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDESOSalesOrderHeader] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderNumberDocumentCompany] ASC,
	[OrderSuffix] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDESOSalesOrderHeader] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDESOSalesOrderHeaderHistory]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderHeaderHistory]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDESOSalesOrderHeaderHistory](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderNumberDocumentCompany] [char](5) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[OriginalOrderDocumentCompany] [char](5) NOT NULL,
	[OriginalOrderNumber] [char](8) NOT NULL,
	[OriginalOrderTypeCode] [char](2) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[ShipTo] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[PromisedDeliveryDate] [datetime] NOT NULL,
	[OriginalPromisedDate] [datetime] NOT NULL,
	[ActualDeliveryDate] [datetime] NOT NULL,
	[CancelDate] [datetime] NOT NULL,
	[PriceEffectiveDate] [datetime] NOT NULL,
	[ShipDate] [datetime] NOT NULL,
	[FutureUseDate] [datetime] NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[Reference2] [char](25) NOT NULL,
	[DeliveryInstructions01] [char](30) NOT NULL,
	[DeliveryInstructions02] [char](30) NOT NULL,
	[PrintMessage] [char](10) NOT NULL,
	[PaymentTerms] [char](3) NOT NULL,
	[PaymentInstrument] [char](1) NOT NULL,
	[AdjustmentSchedule] [char](8) NOT NULL,
	[PricingGroup] [char](8) NOT NULL,
	[TradeDiscount] [decimal](20, 7) NOT NULL,
	[RetainagePercent] [int] NOT NULL,
	[TaxRateArea] [char](10) NOT NULL,
	[TaxExplanationCode] [char](2) NOT NULL,
	[Certificate] [char](20) NOT NULL,
	[AssociatedText] [char](1) NOT NULL,
	[PriorityProcessingCode] [char](1) NOT NULL,
	[BackOrdersAllowed] [char](1) NOT NULL,
	[SubstitutesAllowed] [char](1) NOT NULL,
	[HoldOrdersCode] [char](2) NOT NULL,
	[PricePickList] [char](1) NOT NULL,
	[InvoiceCopies] [int] NOT NULL,
	[NatureofTransaction] [char](2) NOT NULL,
	[BuyerNumber] [int] NOT NULL,
	[PreferredCarrierSales] [int] NOT NULL,
	[ModeOfTransportation] [char](3) NOT NULL,
	[ConditionsOfTransportation] [char](3) NOT NULL,
	[RouteCode] [char](3) NOT NULL,
	[StopCode] [char](3) NOT NULL,
	[ZoneNumber] [char](3) NOT NULL,
	[ContainerID] [char](20) NOT NULL,
	[FreightHandlingCode] [char](3) NOT NULL,
	[ApplyFreightYN] [char](1) NOT NULL,
	[ApplyFreight] [char](1) NOT NULL,
	[FreightCalculated] [char](1) NOT NULL,
	[MergeOrders] [char](1) NOT NULL,
	[CommissionCode01] [int] NOT NULL,
	[CommissionRate1] [decimal](20, 7) NOT NULL,
	[CommissionCode02] [int] NOT NULL,
	[CommissionRate2] [decimal](20, 7) NOT NULL,
	[ReasonCode] [char](3) NOT NULL,
	[PostQuantities] [char](1) NOT NULL,
	[OrderGrossAmount] [decimal](20, 7) NOT NULL,
	[TotalCost] [decimal](20, 7) NOT NULL,
	[WeightDisplayedUOM] [char](2) NOT NULL,
	[VolumeDisplayedUOM] [char](2) NOT NULL,
	[AuthorizationNumCreditApproval] [char](10) NOT NULL,
	[CreditBankAccountNumber] [char](25) NOT NULL,
	[ExpiredDateCreditBankAccount] [datetime] NOT NULL,
	[SubledgerInactiveCode] [char](1) NOT NULL,
	[SendMethod] [char](1) NOT NULL,
	[ModeForeignOrDomestic] [char](1) NOT NULL,
	[CurrencyCode] [char](3) NOT NULL,
	[CurrencyConversionRateSpot] [decimal](20, 7) NOT NULL,
	[LanguagePreferenceCode] [char](2) NOT NULL,
	[ForeignOpenAmount] [decimal](20, 7) NOT NULL,
	[ForeignTotalCost] [decimal](20, 7) NOT NULL,
	[OrderedBy] [char](10) NOT NULL,
	[OrderTakenBy] [char](10) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[IntegrationReference01] [char](60) NOT NULL,
	[IntegrationReference02] [char](60) NOT NULL,
	[IntegrationReference03] [char](60) NOT NULL,
	[IntegrationReference04] [char](60) NOT NULL,
	[IntegrationReference05] [char](60) NOT NULL,
	[Reference] [char](50) NOT NULL,
	[SourceofOrder] [int] NOT NULL,
	[ScheduledShipmentTime] [int] NOT NULL,
	[PromisedDeliveryTime] [int] NOT NULL,
	[DateRequestedShip] [datetime] NOT NULL,
	[TimeFutureTime2] [int] NOT NULL,
	[TimeScheduledPick] [int] NOT NULL,
	[TimeOriginalPromisedDelivery] [int] NOT NULL,
	[RequestedDeliveryTime] [int] NOT NULL,
	[ActualShipmentTime] [int] NOT NULL,
	[DateActualDelivery] [datetime] NOT NULL,
	[AddressNumbePaidBy] [int] NOT NULL,
	[AddressNumberInvoicedTo] [int] NOT NULL,
	[AddressNumberForwardedTo] [int] NOT NULL,
	[AddressNumberDeliverTo] [int] NOT NULL,
	[DocumentOrderInvoiceetc] [int] NOT NULL,
	[DocumentType] [char](60) NOT NULL,
	[ChangeOrderNumber] [int] NOT NULL,
	[BuyingSegmentCode] [char](20) NOT NULL,
	[CurrencyCodeBase] [char](6) NOT NULL,
	[AddressNumbertouseforTax] [char](2) NOT NULL,
	[AddressNumberTransportation] [char](2) NOT NULL,
	[OPBusinessObjective] [char](60) NOT NULL,
	[OPTotalCost] [int] NOT NULL,
	[OPLatestLineDate] [datetime] NOT NULL,
	[OPNumberofBackorders] [int] NOT NULL,
	[OPNumberofSubstitutes] [int] NOT NULL,
	[OPPromisedStatus] [char](60) NOT NULL,
	[OPPartialOrderShipment] [char](60) NOT NULL,
	[OPAllowMultiSource] [char](2) NOT NULL,
	[OPAllowSubstitutes] [char](2) NOT NULL,
	[OPAllowBackorders] [char](2) NOT NULL,
	[OPPartialShipLineItems] [char](2) NOT NULL,
	[PartnerAddressNumber] [int] NOT NULL,
	[OpportunityNumber] [int] NOT NULL,
	[SoldToAttention] [char](50) NOT NULL,
	[ShipToAttention] [char](50) NOT NULL,
	[OrderTypeIndicator] [char](1) NOT NULL,
	[PartnerContactLineNumberID] [int] NOT NULL,
	[CustomerContactLineNumberID] [int] NOT NULL,
	[ShipToCustContactLineNumID] [int] NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDESOSalesOrderHeaderHistory] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderNumberDocumentCompany] ASC,
	[OrderSuffix] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDESOSalesOrderHeaderHistory] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEWOBillofMaterialMasterFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEWOBillofMaterialMasterFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEWOBillofMaterialMasterFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[TypeBillofMaterial] [char](3) NOT NULL,
	[ParentItemNumber] [int] NOT NULL,
	[ItemNumber2ndKit] [char](25) NOT NULL,
	[ItemNumber3rdKit] [char](25) NOT NULL,
	[Branch] [char](12) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[ComponentBranch] [char](12) NOT NULL,
	[ComponentLineNumber] [decimal](20, 7) NOT NULL,
	[SubstituteItemSequenceNumber] [decimal](20, 7) NOT NULL,
	[PartialsAllowedYN] [char](1) NOT NULL,
	[QuantityStandardRequiredQty] [decimal](20, 7) NOT NULL,
	[UnitOfMeasure] [char](2) NOT NULL,
	[BatchQuantity] [decimal](22, 7) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[FixedorVariableBatchSize] [char](1) NOT NULL,
	[EffectiveFromDate] [datetime] NOT NULL,
	[EffectiveThruDate] [datetime] NOT NULL,
	[EffectiveFromSerialNumber] [char](25) NOT NULL,
	[EffectiveThruSerialNumber] [char](25) NOT NULL,
	[IssueTypeCode] [char](1) NOT NULL,
	[Required] [char](1) NOT NULL,
	[OptionalItemKit] [char](1) NOT NULL,
	[DefaultComponent] [char](1) NOT NULL,
	[ComponentCostingMethod] [char](1) NOT NULL,
	[PurchasingCostingMethod] [char](1) NOT NULL,
	[OrderWith] [char](1) NOT NULL,
	[FixedorVariableQuantity] [char](1) NOT NULL,
	[CoProductByProductIntermediate] [char](1) NOT NULL,
	[ComponentType] [char](1) NOT NULL,
	[FromPotency] [decimal](20, 7) NOT NULL,
	[ThruPotency] [decimal](20, 7) NOT NULL,
	[FromGrade] [char](3) NOT NULL,
	[ThruGrade] [char](3) NOT NULL,
	[OperationsSequenceNumber] [decimal](20, 7) NOT NULL,
	[SequenceBubbleSequence] [int] NOT NULL,
	[FeaturePlannedPercent] [decimal](20, 7) NOT NULL,
	[FeatureCostPercent] [decimal](20, 7) NOT NULL,
	[ResourcePercent] [decimal](20, 7) NOT NULL,
	[PercentPercentofScrap] [decimal](20, 7) NOT NULL,
	[PercentRework] [decimal](20, 7) NOT NULL,
	[PercentAsis] [decimal](20, 7) NOT NULL,
	[PercentCumulativePlannedYield] [decimal](20, 7) NOT NULL,
	[OperationScrapPercent] [decimal](20, 7) NOT NULL,
	[LeadtimeOffsetDays] [int] NOT NULL,
	[ECONumber] [char](12) NOT NULL,
	[ECOReason] [char](2) NOT NULL,
	[EngineeringChangeDate] [datetime] NOT NULL,
	[Description01] [char](30) NOT NULL,
	[LineType] [char](2) NOT NULL,
	[UnitPriceperPrimary] [decimal](20, 7) NOT NULL,
	[UnitCost] [decimal](20, 7) NOT NULL,
	[PercentAssemblySalesPrice] [decimal](20, 7) NOT NULL,
	[MessageNumber] [char](10) NOT NULL,
	[PurchasingBusinessUnit] [char](12) NOT NULL,
	[ObjectAccount] [char](6) NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[BillRevisionLevel] [char](3) NOT NULL,
	[ComponentRevisionLevel] [char](3) NOT NULL,
	[LastRevisionNumber] [char](2) NOT NULL,
	[ItemNumberUseUpGoTo] [int] NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[ConsumptionEnd] [decimal](20, 7) NOT NULL,
	[ConsumptionStart] [decimal](20, 7) NOT NULL,
	[SubstituteCounter] [decimal](11, 0) NOT NULL,
	[ComponentLineNumberBOM] [decimal](20, 7) NOT NULL,
	[BubbleSequenceAlphaNumeric] [char](5) NOT NULL,
	[ActiveIngredientFlag] [char](1) NOT NULL,
	[ConstraintsFlag] [char](1) NOT NULL,
	[LeanSuperflushFlag] [char](1) NOT NULL,
	[PrepCode] [char](4) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEWOBillofMaterialsMasterFile] PRIMARY KEY CLUSTERED 
(
	[TypeBillofMaterial] ASC,
	[ParentItemNumber] ASC,
	[Branch] ASC,
	[ComponentLineNumberBOM] ASC,
	[SubstituteItemSequenceNumber] ASC,
	[BatchQuantity] ASC,
	[CoProductByProductIntermediate] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEWOBillofMaterialMasterFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[JDEWOWorkOrderMasterFile]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[JDEWOWorkOrderMasterFile]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[JDEWOWorkOrderMasterFile](
	[SourceID] [int] NOT NULL,
	[Source] [char](20) NOT NULL,
	[OrderTypeCode] [char](2) NOT NULL,
	[OrderNumber] [int] NOT NULL,
	[OrderSuffix] [char](3) NOT NULL,
	[RelatedPoSoWoType] [char](2) NOT NULL,
	[RelatedPoSoWoNumber] [char](8) NOT NULL,
	[LineNumber] [decimal](20, 7) NOT NULL,
	[PegtoWorkOrder] [int] NOT NULL,
	[NumberParentWONumber] [char](8) NOT NULL,
	[TypeWO] [char](1) NOT NULL,
	[PriorityWO] [char](1) NOT NULL,
	[Description01] [char](30) NOT NULL,
	[StatusComment] [char](30) NOT NULL,
	[CompanyNumber] [char](5) NOT NULL,
	[BusinessUnitCode] [char](12) NOT NULL,
	[Branch] [char](12) NOT NULL,
	[Location] [char](20) NOT NULL,
	[Aisle] [char](8) NOT NULL,
	[Bin] [char](8) NOT NULL,
	[StatusCodeWO] [char](2) NOT NULL,
	[DateStatusChanged] [datetime] NOT NULL,
	[Subsidiary] [char](8) NOT NULL,
	[AddressNumber] [int] NOT NULL,
	[AddressNumberOriginator] [int] NOT NULL,
	[AddressNumberManager] [int] NOT NULL,
	[Supervisor] [int] NOT NULL,
	[AddressNumberAssignedTo] [int] NOT NULL,
	[DateWOPlannedCompleted] [datetime] NOT NULL,
	[AddressNumberInspector] [int] NOT NULL,
	[NextAddressNumber] [int] NOT NULL,
	[TransactionDate] [datetime] NOT NULL,
	[DateStartJulian] [datetime] NOT NULL,
	[RequestedDate] [datetime] NOT NULL,
	[DateCompletionJulian] [datetime] NOT NULL,
	[DateAssignedto] [datetime] NOT NULL,
	[DateAssignedtoInspector] [datetime] NOT NULL,
	[DatePaperPrintedDate] [datetime] NOT NULL,
	[Phase] [char](4) NOT NULL,
	[CategoriesWorkOrder02] [char](3) NOT NULL,
	[CategoriesWorkOrder03] [char](3) NOT NULL,
	[CategoriesWorkOrder04] [char](3) NOT NULL,
	[CategoriesWorkOrder05] [char](3) NOT NULL,
	[JDEConsultingStatus] [char](3) NOT NULL,
	[JDEConsultingServiceType] [char](3) NOT NULL,
	[JDEConsultingSkillType] [char](3) NOT NULL,
	[JDEConsultingExperienceLevel] [char](3) NOT NULL,
	[CategoriesWorkOrder10] [char](3) NOT NULL,
	[Reference1] [char](25) NOT NULL,
	[Reference2] [char](25) NOT NULL,
	[AmountEstimated] [decimal](20, 7) NOT NULL,
	[CrewSize] [int] NOT NULL,
	[RateRevenueOverrideRateMarkup] [decimal](20, 7) NOT NULL,
	[PayDeductionBenefitType] [char](5) NOT NULL,
	[AmountChangetoOriginalDollars] [decimal](20, 7) NOT NULL,
	[HoursEstimated] [decimal](20, 7) NOT NULL,
	[HoursChangetoOriginalHours] [decimal](20, 7) NOT NULL,
	[AmountActual] [decimal](20, 7) NOT NULL,
	[HoursActual] [decimal](20, 7) NOT NULL,
	[ItemNumber] [int] NOT NULL,
	[ItemNumber03] [char](25) NOT NULL,
	[ItemNumber02] [char](25) NOT NULL,
	[AssetItemNumber] [int] NOT NULL,
	[UnitorTagNumber] [char](12) NOT NULL,
	[QuantityOrdered] [decimal](22, 7) NOT NULL,
	[QuantityBackordered] [decimal](22, 7) NOT NULL,
	[QuantityCanceled] [decimal](22, 7) NOT NULL,
	[QuantityShipped] [decimal](22, 7) NOT NULL,
	[QuantityShippedToDate] [decimal](22, 7) NOT NULL,
	[UnitOfMeasureAsInput] [char](2) NOT NULL,
	[MessageNumber] [char](10) NOT NULL,
	[TimeBeginningHHMMSS] [int] NOT NULL,
	[TypeBillofMaterial] [char](3) NOT NULL,
	[TypeofRouting] [char](3) NOT NULL,
	[WOPickListPrinted] [char](1) NOT NULL,
	[PostingEditCode] [char](1) NOT NULL,
	[VarianceFlag] [char](1) NOT NULL,
	[BillofMaterialN] [char](1) NOT NULL,
	[RouteSheetN] [char](1) NOT NULL,
	[WorkOrderFlashMessage] [char](1) NOT NULL,
	[FreezeCode] [char](1) NOT NULL,
	[IndentedCode] [char](1) NOT NULL,
	[ResequenceCode] [int] NOT NULL,
	[AmountMilesorHoursunits] [decimal](20, 7) NOT NULL,
	[DateScheduledTickler] [datetime] NOT NULL,
	[MemoBudgetChange] [decimal](20, 7) NOT NULL,
	[PercentComplete] [decimal](20, 7) NOT NULL,
	[LeadtimeLevel] [int] NOT NULL,
	[LeadtimeCumulative] [int] NOT NULL,
	[HoursUnaccountedDirectLabor] [decimal](20, 7) NOT NULL,
	[LotNumber] [char](30) NOT NULL,
	[LotPotency] [decimal](20, 7) NOT NULL,
	[LotGrade] [char](3) NOT NULL,
	[RatioCriticalRatioPriority1] [decimal](20, 7) NOT NULL,
	[RatioCriticalRatioPriority2] [decimal](20, 7) NOT NULL,
	[DocumentType] [char](2) NOT NULL,
	[SubledgerInactiveCode] [char](1) NOT NULL,
	[RelatedOrderKeyCompany] [char](5) NOT NULL,
	[BillRevisionLevel] [char](3) NOT NULL,
	[RoutingRevisionLevel] [char](3) NOT NULL,
	[DrawingChange] [char](1) NOT NULL,
	[RoutingChange] [char](1) NOT NULL,
	[NewPartNumber] [char](1) NOT NULL,
	[ReasonforECO] [char](2) NOT NULL,
	[PhaseIn] [char](3) NOT NULL,
	[ExistingDisposition] [char](3) NOT NULL,
	[BOMChange] [char](1) NOT NULL,
	[UserReservedCode] [char](2) NOT NULL,
	[UserReservedDate] [datetime] NOT NULL,
	[UserReservedAmount] [decimal](20, 7) NOT NULL,
	[UserReservedNumber] [int] NOT NULL,
	[UserReservedReference] [char](15) NOT NULL,
	[UserID] [char](10) NOT NULL,
	[ProgramID] [char](10) NOT NULL,
	[WorkStationID] [char](10) NOT NULL,
	[DateUpdated] [datetime] NOT NULL,
	[TimeOfDay] [int] NOT NULL,
	[ParentNumber] [int] NOT NULL,
	[NextStatusWO] [char](2) NOT NULL,
	[CriticalityWorkOrder] [int] NOT NULL,
	[EstimatedDowntimeHours] [int] NOT NULL,
	[ActualDowntimeHours] [int] NOT NULL,
	[ServiceAddressNumber] [int] NOT NULL,
	[MeterPosition] [int] NOT NULL,
	[ApprovalType] [char](3) NOT NULL,
	[AmountEstimatedLabor] [decimal](20, 7) NOT NULL,
	[AmountEstimatedMaterial] [decimal](20, 7) NOT NULL,
	[AmountEstimatedOther] [decimal](20, 7) NOT NULL,
	[AmountActualLabor] [decimal](20, 7) NOT NULL,
	[AmountActualMaterial] [decimal](20, 7) NOT NULL,
	[InsertIndicator] [int] NOT NULL,
	[InsertDate] [datetime] NOT NULL,
	[ChangeIndicator] [int] NOT NULL,
	[ChangeDate] [datetime] NOT NULL,
	[DeleteIndicator] [int] NOT NULL,
	[DeleteDate] [datetime] NOT NULL,
	[PurgeDate] [datetime] NOT NULL,
 CONSTRAINT [PK_JDEWOWorkOrderMasterFile] PRIMARY KEY CLUSTERED 
(
	[OrderNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[JDEWOWorkOrderMasterFile] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[RD_ARMART_FACTS1]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[RD_ARMART_FACTS1]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[RD_ARMART_FACTS1](
	[FACTSEXTID] [varchar](60) NULL,
	[BUSINESSUNITID] [varchar](20) NULL,
	[CUSTOMERNUMBERID] [decimal](28, 0) NULL,
	[COMPANYNUMBERID] [decimal](28, 0) NULL,
	[DEDUCTIONACTIVITYCODEID] [varchar](10) NULL,
	[DOCUMENTID] [varchar](10) NULL,
	[TYPEID] [varchar](1) NULL,
	[PAYMENTTERMSID] [varchar](10) NULL,
	[SOURCEID] [int] NOT NULL,
	[SOURCE] [varchar](20) NULL,
	[DOCUMENTNUMBER] [int] NOT NULL,
	[DOCUMENTTYPE] [varchar](2) NOT NULL,
	[PAYITEM] [varchar](3) NOT NULL,
	[DOCUMENTCOMPANY] [varchar](5) NOT NULL,
	[INTERNALPAYMENTID] [int] NOT NULL,
	[FILELINEIDENTIFIER] [int] NOT NULL,
	[COMPANY] [varchar](5) NULL,
	[BUSINESSUNITCODE] [varchar](12) NULL,
	[BILLTONUMBER] [int] NULL,
	[INVOICETYPE] [varchar](1) NOT NULL,
	[DEDUCTIONID] [decimal](15, 0) NULL,
	[GROSSAMOUNT] [decimal](20, 7) NULL,
	[TRANSACTIONOPENAMOUNT] [decimal](20, 7) NULL,
	[AMOUNTPAID] [decimal](20, 7) NULL,
	[AMOUNTWRITEOFF] [decimal](20, 7) NULL,
	[TRANSACTIONORIGINATOR] [varchar](10) NULL,
	[OMSPONUMBER] [varchar](25) NULL,
	[OMSINVOICENUMBER] [varchar](30) NULL,
	[OMSCONFIRMNUMBER] [int] NULL,
	[CHECKNUMBER] [varchar](25) NULL,
	[TRANSACTIONWRITEOFFCODE] [varchar](2) NULL,
	[GLDATEID] [float] NULL,
	[INVOICEDATEID] [float] NULL,
	[ORIGINALDOCUMENTNUMBER] [int] NULL,
	[ORIGINALDOCUMENTTYPE] [varchar](2) NULL,
	[ORIGINALORDERDOCUMENTCOMPANY] [varchar](5) NULL,
	[ORIGINALPAYITEM] [varchar](3) NULL,
	[TRANSACTIONDISCOUNTAVAILABLE] [decimal](20, 7) NULL,
	[DISCOUNTTAKEN] [decimal](20, 7) NULL,
	[DUEDATEID] [float] NULL,
	[DISCOUNTDUEDATEID] [float] NULL,
	[CURRENCYCODEBASE] [varchar](3) NULL,
	[CURRENCYCONVERSIONRATESPOT] [decimal](20, 7) NULL,
	[CURRENCYCODE] [varchar](3) NULL,
	[GLPOSTEDCODE] [varchar](1) NULL,
	[BATCHNUMBER] [int] NULL,
	[BATCHTYPE] [varchar](2) NULL,
	[BATCHDATEID] [float] NULL,
	[GLVOIDDATEID] [float] NULL,
	[FOREIGNDISCOUNTAVAILABLE] [decimal](20, 7) NULL,
	[FOREIGNDISCOUNTTAKEN] [decimal](20, 7) NULL,
	[TRANSACTIONDEDUCTIONCODE] [varchar](2) NULL,
	[CHECKITEMDATEID] [float] NULL,
	[PAYMENTAMOUNT] [decimal](20, 7) NULL,
	[DOCUMENTNUMBERJE] [int] NULL,
	[DOCUMENTTYPEJE] [varchar](2) NULL,
	[AMOUNTCHARGEBACK] [decimal](20, 7) NULL,
	[TRANSACTIONCHARGEBACKCODE] [varchar](2) NULL,
	[TRANSACTIONREMARK] [varchar](30) NULL,
	[PAYORADDRESSNUMBER] [int] NULL,
	[PAYSTATUS] [varchar](1) NULL,
	[FOREIGNTAXAMOUNT] [decimal](20, 7) NULL,
	[FOREIGNTAXABLEAMOUNT] [decimal](20, 7) NULL,
	[FOREIGNNONTAXABLEAMOUNT] [decimal](20, 7) NULL,
	[FOREIGNOPENAMOUNT] [decimal](20, 7) NULL,
	[ORIGINALINVOICENUMBER] [varchar](25) NULL,
	[DATECLOSEDID] [float] NULL,
	[TRANSACTIONCHARGEBACKAMOUNT] [decimal](20, 7) NULL,
	[TRANSACTIONPAYMENTAMOUNT] [decimal](20, 7) NULL,
	[TRANSACTIONDISCOUNTAMOUNT] [decimal](20, 7) NULL,
	[TRANSACTIONWRITEOFFAMOUNT] [decimal](20, 7) NULL,
	[DEDUCTIONACTIVITYCODE] [varchar](2) NULL,
	[DEDUCTIONMANAGER] [int] NULL,
	[CASHRECEIVED] [decimal](20, 7) NULL,
	[PAYITEMEXTENSIONNUMBER] [int] NULL,
	[TAXABLEAMOUNT] [decimal](15, 2) NULL,
	[NONTAXABLEAMOUNT] [decimal](15, 2) NULL,
	[TAXAMOUNT] [decimal](15, 2) NULL,
	[TAXRATEAREA] [varchar](10) NULL,
	[TAXEXPLANATIONCODE] [varchar](2) NULL,
	[GLOFFSET] [varchar](4) NULL,
	[ACCOUNTID] [varchar](8) NULL,
	[PARENTNUMBER] [int] NULL,
	[AMOUNTDEDUCTION] [decimal](20, 7) NULL,
	[SUBLEDGER] [varchar](8) NULL,
	[SUBLEDGERTYPE] [varchar](1) NULL,
	[PURCHASEORDERDOCUMENTCOMPANY] [varchar](5) NULL,
	[PONUMBER] [varchar](8) NULL,
	[PURCHASEORDERDOCUMENTTYPE] [varchar](2) NULL,
	[ORDERTYPE] [varchar](2) NULL,
	[INSERTINDICATOR] [int] NULL,
	[INSERTDATE] [datetime] NULL,
	[CHANGEINDICATOR] [int] NULL,
	[CHANGEDATE] [datetime] NULL,
	[DELETEINDICATOR] [int] NULL,
	[DELETEDATE] [datetime] NULL,
	[PURGEDATE] [datetime] NULL,
PRIMARY KEY CLUSTERED 
(
	[SOURCEID] ASC,
	[DOCUMENTNUMBER] ASC,
	[DOCUMENTTYPE] ASC,
	[PAYITEM] ASC,
	[DOCUMENTCOMPANY] ASC,
	[INTERNALPAYMENTID] ASC,
	[FILELINEIDENTIFIER] ASC,
	[INVOICETYPE] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[RD_ARMART_FACTS1] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[RD_MONITOR_GL]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[RD_MONITOR_GL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[RD_MONITOR_GL](
	[JDE_DATE] [datetime] NOT NULL,
	[DWCR_DATE] [datetime] NOT NULL,
	[TIMING] [int] NOT NULL
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[RD_MONITOR_GL] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[TEMLOOKUPS]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TEMLOOKUPS]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TEMLOOKUPS](
	[SOURCEID] [int] NULL,
	[INVOICETONUMBER] [int] NULL,
	[PARENTNUMBER] [int] NULL,
	[SOLDTORELATED] [int] NULL,
	[SOLDTONUMBER] [int] NULL
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[TEMLOOKUPS] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[TEST_F0010]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TEST_F0010]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TEST_F0010](
	[CCCO] [nchar](5) NOT NULL,
	[CCNAME] [nchar](30) NULL,
	[CCALTC] [nchar](40) NULL,
	[CCDFYJ] [numeric](6, 0) NULL,
	[CCPNC] [numeric](2, 0) NULL,
	[CCDOT1] [nchar](1) NULL,
	[CCCRYR] [nchar](1) NULL,
	[CCCRYC] [nchar](1) NULL,
	[CCDOT2] [nchar](1) NULL,
	[CCMCUA] [nchar](1) NULL,
	[CCMCUD] [nchar](1) NULL,
	[CCMCUC] [nchar](1) NULL,
	[CCMCUB] [nchar](1) NULL,
	[CCDPRC] [nchar](1) NULL,
	[CCBKTX] [nchar](1) NULL,
	[CCTXBM] [numeric](2, 0) NULL,
	[CCTXBO] [numeric](2, 0) NULL,
	[CCNWXJ] [numeric](6, 0) NULL,
	[CCGLIE] [nchar](1) NULL,
	[CCABIN] [nchar](1) NULL,
	[CCCALD] [nchar](2) NULL,
	[CCDTPN] [nchar](1) NULL,
	[CCPNF] [numeric](2, 0) NULL,
	[CCDFF] [numeric](2, 0) NULL,
	[CCCRCD] [nchar](3) NULL,
	[CCSMI] [nchar](1) NULL,
	[CCSMU] [nchar](1) NULL,
	[CCSMS] [nchar](1) NULL,
	[CCDNLT] [nchar](1) NULL,
	[CCSTMT] [nchar](1) NULL,
	[CCATCS] [nchar](1) NULL,
	[CCALGM] [nchar](2) NULL,
	[CCAGEM] [nchar](1) NULL,
	[CCCRDY] [decimal](3, 0) NULL,
	[CCAGR1] [numeric](3, 0) NULL,
	[CCAGR2] [numeric](3, 0) NULL,
	[CCAGR3] [numeric](3, 0) NULL,
	[CCAGR4] [numeric](3, 0) NULL,
	[CCAGR5] [numeric](3, 0) NULL,
	[CCAGR6] [numeric](3, 0) NULL,
	[CCAGR7] [numeric](3, 0) NULL,
	[CCFRY] [numeric](2, 0) NULL,
	[CCFRP] [numeric](2, 0) NULL,
	[CCNNP] [numeric](2, 0) NULL,
	[CCFP] [decimal](9, 6) NULL,
	[CCAGE] [nchar](1) NULL,
	[CCDAG] [numeric](6, 0) NULL,
	[CCARPN] [numeric](2, 0) NULL,
	[CCAPPN] [numeric](2, 0) NULL,
	[CCARFJ] [numeric](6, 0) NULL,
	[CCAPFJ] [numeric](6, 0) NULL,
	[CCAN8] [numeric](8, 0) NULL,
	[CCSGBK] [nchar](40) NULL,
	[CCPTCO] [nchar](1) NULL,
	[CCX1] [nchar](1) NULL,
	[CCX2] [nchar](1) NULL,
	[CCUSER] [nchar](10) NULL,
	[CCPID] [nchar](10) NULL,
	[CCUPMJ] [numeric](6, 0) NULL,
	[CCJOBN] [nchar](10) NULL,
	[CCUPMT] [numeric](6, 0) NULL,
	[CCTSID] [numeric](3, 0) NULL,
	[CCTSCO] [nchar](5) NULL,
	[CCTHCO] [nchar](3) NULL,
	[CCAN8C] [numeric](8, 0) NULL,
 CONSTRAINT [PK_TEST_F0010] PRIMARY KEY CLUSTERED 
(
	[CCCO] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
ALTER AUTHORIZATION ON [dbo].[TEST_F0010] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[TMP_DF_ARLOB_ADDRESSES]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TMP_DF_ARLOB_ADDRESSES]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TMP_DF_ARLOB_ADDRESSES](
	[SOURCEID] [int] NOT NULL,
	[ADDRESSNUMBER] [int] NOT NULL,
	[SEARCHTYPECODE] [varchar](3) NULL,
	[SEARCHTYPE] [varchar](30) NULL,
	[MAILINGNAME] [varchar](40) NULL,
	[ADDRESSLINE1] [varchar](40) NULL,
	[ADDRESSLINE2] [varchar](40) NULL,
	[ADDRESSLINE3] [varchar](40) NULL,
	[ADDRESSLINE4] [varchar](40) NULL,
	[POSTALCODE] [varchar](12) NULL,
	[CITY] [varchar](25) NULL,
	[COUNTY] [varchar](25) NULL,
	[STATECODE] [varchar](3) NULL,
	[STATE] [varchar](30) NULL,
	[COUNTRYCODE] [varchar](3) NULL,
	[COUNTRY] [varchar](30) NULL,
	[CATEGORY01CODE] [varchar](3) NULL,
	[CATEGORY01] [varchar](30) NULL,
	[CATEGORY02CODE] [varchar](3) NULL,
	[CATEGORY02] [varchar](30) NULL,
	[CATEGORY03CODE] [varchar](3) NULL,
	[CATEGORY03] [varchar](30) NULL,
	[CATEGORY04CODE] [varchar](3) NULL,
	[CATEGORY04] [varchar](30) NULL,
	[CATEGORY05CODE] [varchar](3) NULL,
	[CATEGORY05] [varchar](30) NULL,
	[CATEGORY06CODE] [varchar](3) NULL,
	[CATEGORY06] [varchar](30) NULL,
	[CATEGORY07CODE] [varchar](3) NULL,
	[CATEGORY07] [varchar](30) NULL,
	[CATEGORY08CODE] [varchar](3) NULL,
	[CATEGORY08] [varchar](30) NULL,
	[CATEGORY09CODE] [varchar](3) NULL,
	[CATEGORY09] [varchar](30) NULL,
	[CATEGORY10CODE] [varchar](3) NULL,
	[CATEGORY10] [varchar](30) NULL,
	[CATEGORY11CODE] [varchar](3) NULL,
	[CATEGORY11] [varchar](30) NULL,
	[CATEGORY12CODE] [varchar](3) NULL,
	[CATEGORY12] [varchar](30) NULL,
	[CATEGORY13CODE] [varchar](3) NULL,
	[CATEGORY13] [varchar](30) NULL,
	[CATEGORY14CODE] [varchar](3) NULL,
	[CATEGORY14] [varchar](30) NULL,
	[CATEGORY15CODE] [varchar](3) NULL,
	[CATEGORY15] [varchar](30) NULL,
	[CATEGORY16CODE] [varchar](3) NULL,
	[CATEGORY16] [varchar](30) NULL,
	[CATEGORY17CODE] [varchar](3) NULL,
	[CATEGORY17] [varchar](30) NULL,
	[CATEGORY18CODE] [varchar](3) NULL,
	[CATEGORY18] [varchar](30) NULL,
	[CATEGORY19CODE] [varchar](3) NULL,
	[CATEGORY19] [varchar](30) NULL,
	[CATEGORY20CODE] [varchar](3) NULL,
	[CATEGORY20] [varchar](30) NULL,
	[CATEGORY21CODE] [varchar](3) NULL,
	[CATEGORY21] [varchar](30) NULL,
	[CATEGORY22CODE] [varchar](3) NULL,
	[CATEGORY22] [varchar](30) NULL,
	[CATEGORY23CODE] [varchar](3) NULL,
	[CATEGORY23] [varchar](30) NULL,
	[CATEGORY24CODE] [varchar](3) NULL,
	[CATEGORY24] [varchar](30) NULL,
	[CATEGORY25CODE] [varchar](3) NULL,
	[CATEGORY25] [varchar](30) NULL,
	[CATEGORY26CODE] [varchar](3) NULL,
	[CATEGORY26] [varchar](30) NULL,
	[CATEGORY27CODE] [varchar](3) NULL,
	[CATEGORY27] [varchar](30) NULL,
	[CATEGORY28CODE] [varchar](3) NULL,
	[CATEGORY28] [varchar](30) NULL,
	[CATEGORY29CODE] [varchar](3) NULL,
	[CATEGORY29] [varchar](30) NULL,
	[CATEGORY30CODE] [varchar](3) NULL,
	[CATEGORY30] [varchar](30) NULL,
PRIMARY KEY CLUSTERED 
(
	[SOURCEID] ASC,
	[ADDRESSNUMBER] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[TMP_DF_ARLOB_ADDRESSES] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[TMP_SALES_STAR_CUSTOMER]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TMP_SALES_STAR_CUSTOMER]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TMP_SALES_STAR_CUSTOMER](
	[CUSTOMERNUMBERID] [decimal](28, 0) NOT NULL,
	[SOURCEID] [int] NULL,
	[SOURCE] [varchar](20) NULL,
	[PARENTNUMBER] [int] NULL,
	[PARENTNAME] [varchar](40) NULL,
	[PARENTADDRESSLINE01] [varchar](40) NULL,
	[PARENTADDRESSLINE02] [varchar](40) NULL,
	[PARENTADDRESSLINE03] [varchar](40) NULL,
	[PARENTADDRESSLINE04] [varchar](40) NULL,
	[PARENTPOSTALCODE] [varchar](12) NULL,
	[PARENTCITY] [varchar](25) NULL,
	[PARENTCOUNTY] [varchar](25) NULL,
	[PARENTSTATECODE] [varchar](3) NULL,
	[PARENTSTATE] [varchar](30) NULL,
	[PARENTCOUNTRY] [varchar](30) NULL,
	[PARENTCOUNTRYCODE] [varchar](3) NULL,
	[INVOICETONUMBER] [int] NULL,
	[INVOICETONAME] [varchar](40) NULL,
	[INVOICETOADDRESSLINE01] [varchar](40) NULL,
	[INVOICETOADDRESSLINE02] [varchar](40) NULL,
	[INVOICETOADDRESSLINE03] [varchar](40) NULL,
	[INVOICETOADDRESSLINE04] [varchar](40) NULL,
	[INVOICETOPOSTALCODE] [varchar](12) NULL,
	[INVOICETOCITY] [varchar](25) NULL,
	[INVOICETOCOUNTY] [varchar](25) NULL,
	[INVOICETOSTATECODE] [varchar](3) NULL,
	[INVOICETOSTATE] [varchar](30) NULL,
	[INVOICETOCOUNTRY] [varchar](30) NULL,
	[INVOICETOCOUNTRYCODE] [varchar](3) NULL,
	[INVOICETOSEARCHTYPECODE] [varchar](3) NULL,
	[INVOICETOSEARCHTYPE] [varchar](30) NULL,
	[SOLDTONUMBER] [int] NULL,
	[SOLDTONAME] [varchar](40) NULL,
	[SOLDTOADDRESSLINE01] [varchar](40) NULL,
	[SOLDTOADDRESSLINE02] [varchar](40) NULL,
	[SOLDTOADDRESSLINE03] [varchar](40) NULL,
	[SOLDTOADDRESSLINE04] [varchar](40) NULL,
	[SOLDTOPOSTALCODE] [varchar](12) NULL,
	[SOLDTOCITY] [varchar](25) NULL,
	[SOLDTOCOUNTY] [varchar](25) NULL,
	[SOLDTOSTATECODE] [varchar](3) NULL,
	[SOLDTOSTATE] [varchar](30) NULL,
	[SOLDTOCOUNTRY] [varchar](30) NULL,
	[SOLDTOCOUNTRYCODE] [varchar](3) NULL,
	[SOLDTOSEARCHTYPECODE] [varchar](3) NULL,
	[SOLDTOSEARCHTYPE] [varchar](30) NULL,
	[SHIPTONUMBER] [int] NULL,
	[SHIPTONAME] [varchar](40) NULL,
	[SHIPTOADDRESSLINE01] [varchar](40) NULL,
	[SHIPTOADDRESSLINE02] [varchar](40) NULL,
	[SHIPTOADDRESSLINE03] [varchar](40) NULL,
	[SHIPTOADDRESSLINE04] [varchar](40) NULL,
	[SHIPTOPOSTALCODE] [varchar](12) NULL,
	[SHIPTOCITY] [varchar](25) NULL,
	[SHIPTOCOUNTY] [varchar](25) NULL,
	[SHIPTOSTATECODE] [varchar](3) NULL,
	[SHIPTOSTATE] [varchar](30) NULL,
	[SHIPTOCOUNTRY] [varchar](30) NULL,
	[SHIPTOCOUNTRYCODE] [varchar](3) NULL,
	[SHIPTOSEARCHTYPECODE] [varchar](3) NULL,
	[SHIPTOSEARCHTYPE] [varchar](30) NULL,
	[RELATEDADDRESSNUMBER] [int] NULL,
	[CATEGORY01CODE] [varchar](3) NULL,
	[CATEGORY01] [varchar](30) NULL,
	[CATEGORY02CODE] [varchar](3) NULL,
	[CATEGORY02] [varchar](30) NULL,
	[CATEGORY03CODE] [varchar](3) NULL,
	[CATEGORY03] [varchar](30) NULL,
	[CATEGORY04CODE] [varchar](3) NULL,
	[CATEGORY04] [varchar](30) NULL,
	[CATEGORY05CODE] [varchar](3) NULL,
	[CATEGORY05] [varchar](30) NULL,
	[CATEGORY06CODE] [varchar](3) NULL,
	[CATEGORY06] [varchar](30) NULL,
	[CATEGORY07CODE] [varchar](3) NULL,
	[CATEGORY07] [varchar](30) NULL,
	[CATEGORY08CODE] [varchar](3) NULL,
	[CATEGORY08] [varchar](30) NULL,
	[CATEGORY09CODE] [varchar](3) NULL,
	[CATEGORY09] [varchar](30) NULL,
	[CATEGORY10CODE] [varchar](3) NULL,
	[CATEGORY10] [varchar](30) NULL,
	[CATEGORY11CODE] [varchar](3) NULL,
	[CATEGORY11] [varchar](30) NULL,
	[CATEGORY12CODE] [varchar](3) NULL,
	[CATEGORY12] [varchar](30) NULL,
	[CATEGORY13CODE] [varchar](3) NULL,
	[CATEGORY13] [varchar](30) NULL,
	[CATEGORY14CODE] [varchar](3) NULL,
	[CATEGORY14] [varchar](30) NULL,
	[CATEGORY15CODE] [varchar](3) NULL,
	[CATEGORY15] [varchar](30) NULL,
	[CATEGORY16CODE] [varchar](3) NULL,
	[CATEGORY16] [varchar](30) NULL,
	[CATEGORY17CODE] [varchar](3) NULL,
	[CATEGORY17] [varchar](30) NULL,
	[CATEGORY18CODE] [varchar](3) NULL,
	[CATEGORY18] [varchar](30) NULL,
	[CATEGORY19CODE] [varchar](3) NULL,
	[CATEGORY19] [varchar](30) NULL,
	[CATEGORY20CODE] [varchar](3) NULL,
	[CATEGORY20] [varchar](30) NULL,
	[CATEGORY21CODE] [varchar](3) NULL,
	[CATEGORY21] [varchar](30) NULL,
	[CATEGORY22CODE] [varchar](3) NULL,
	[CATEGORY22] [varchar](30) NULL,
	[CATEGORY23CODE] [varchar](3) NULL,
	[CATEGORY23] [varchar](30) NULL,
	[CATEGORY24CODE] [varchar](3) NULL,
	[CATEGORY24] [varchar](30) NULL,
	[CATEGORY25CODE] [varchar](3) NULL,
	[CATEGORY25] [varchar](30) NULL,
	[CATEGORY26CODE] [varchar](3) NULL,
	[CATEGORY26] [varchar](30) NULL,
	[CATEGORY27CODE] [varchar](3) NULL,
	[CATEGORY27] [varchar](30) NULL,
	[CATEGORY28CODE] [varchar](3) NULL,
	[CATEGORY28] [varchar](30) NULL,
	[CATEGORY29CODE] [varchar](3) NULL,
	[CATEGORY29] [varchar](30) NULL,
	[CATEGORY30CODE] [varchar](3) NULL,
	[CATEGORY30] [varchar](30) NULL,
	[COMPANYNUMBER] [varchar](5) NULL,
	[CREDITLIMIT] [decimal](20, 7) NULL,
	[SOLDTORELATED] [int] NULL,
	[INSERTINDICATOR] [int] NULL,
	[INSERTDATE] [datetime] NULL,
	[CHANGEINDICATOR] [int] NULL,
	[CHANGEDATE] [datetime] NULL,
	[DELETEINDICATOR] [int] NULL,
	[DELETEDATE] [datetime] NULL,
	[PURGEDATE] [datetime] NULL,
PRIMARY KEY CLUSTERED 
(
	[CUSTOMERNUMBERID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[TMP_SALES_STAR_CUSTOMER] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[ValueTransFieldReferences]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ValueTransFieldReferences]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ValueTransFieldReferences](
	[srcsysid] [varchar](8) NOT NULL,
	[srcfilnme] [varchar](257) NOT NULL,
	[srcfillib] [varchar](128) NOT NULL,
	[tgtentnme] [varchar](128) NOT NULL,
	[tgtschema] [varchar](128) NOT NULL,
	[atrnme] [varchar](128) NOT NULL,
	[SourceID] [int] NOT NULL,
	[tgtdb] [varchar](128) NOT NULL,
	[srccodefield] [char](26) NOT NULL,
	[tgtcodefield] [varchar](128) NOT NULL,
	[InstallSystemCode] [char](4) NOT NULL,
	[UserDefinedCode] [char](2) NOT NULL,
	[UpdateStatus] [char](3) NOT NULL,
	[UpdateOnLine] [char](3) NOT NULL,
	[UpdateNightlyStatus] [char](3) NOT NULL,
	[UpdateEmail] [varchar](257) NULL,
 CONSTRAINT [PK_ValueTransFieldReferences] PRIMARY KEY CLUSTERED 
(
	[srcfilnme] ASC,
	[atrnme] ASC,
	[srcfillib] ASC,
	[srcsysid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[ValueTransFieldReferences] TO  SCHEMA OWNER 
GO
/****** Object:  Table [dbo].[ValueTransHostSource]    Script Date: 5/30/13 10:14:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ValueTransHostSource]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ValueTransHostSource](
	[SourceID] [int] NOT NULL,
	[HostName] [char](10) NOT NULL,
	[UETableName] [varchar](50) NOT NULL,
 CONSTRAINT [PK_ValueTransHostSource] PRIMARY KEY CLUSTERED 
(
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_PADDING OFF
GO
ALTER AUTHORIZATION ON [dbo].[ValueTransHostSource] TO  SCHEMA OWNER 
GO
/****** Object:  Index [missing_index_1241]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[DATES]') AND name = N'missing_index_1241')
CREATE NONCLUSTERED INDEX [missing_index_1241] ON [dbo].[DATES]
(
	[Dates] ASC
)
INCLUDE ( 	[DateID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_530]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[DATES]') AND name = N'missing_index_530')
CREATE NONCLUSTERED INDEX [missing_index_530] ON [dbo].[DATES]
(
	[CalendarYear] ASC,
	[CalendarMonth] ASC
)
INCLUDE ( 	[DateID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_532]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[DATES]') AND name = N'missing_index_532')
CREATE NONCLUSTERED INDEX [missing_index_532] ON [dbo].[DATES]
(
	[WorkDay] ASC
)
INCLUDE ( 	[DateID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_534]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[DATES]') AND name = N'missing_index_534')
CREATE NONCLUSTERED INDEX [missing_index_534] ON [dbo].[DATES]
(
	[SalesDay] ASC
)
INCLUDE ( 	[DateID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_143]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEABAddressBookMaster]') AND name = N'missing_index_143')
CREATE NONCLUSTERED INDEX [missing_index_143] ON [dbo].[JDEABAddressBookMaster]
(
	[SearchTypeCode] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_374]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEABAddressBookMaster]') AND name = N'missing_index_374')
CREATE NONCLUSTERED INDEX [missing_index_374] ON [dbo].[JDEABAddressBookMaster]
(
	[SourceID] ASC
)
INCLUDE ( 	[AddressNumber],
	[Category02Code],
	[Category02]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_377]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEARCMbyLineofBusines]') AND name = N'missing_index_377')
CREATE NONCLUSTERED INDEX [missing_index_377] ON [dbo].[JDEARCMbyLineofBusines]
(
	[SourceID] ASC
)
INCLUDE ( 	[AddressNumber],
	[CompanyNumber],
	[Category02Code],
	[Category02]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_214]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAAssetAccountBalancesFile]') AND name = N'missing_index_214')
CREATE NONCLUSTERED INDEX [missing_index_214] ON [dbo].[JDEFAAssetAccountBalancesFile]
(
	[AssetItemNumber] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_216]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAAssetAccountBalancesFile]') AND name = N'missing_index_216')
CREATE NONCLUSTERED INDEX [missing_index_216] ON [dbo].[JDEFAAssetAccountBalancesFile]
(
	[AssetItemNumber] ASC
)
INCLUDE ( 	[PriorYearCloseBalance],
	[ObjectAccount],
	[Subsidiary]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_ParentUnitOrTagNumberLookup]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAAssetMasterFile]') AND name = N'IX_ParentUnitOrTagNumberLookup')
CREATE NONCLUSTERED INDEX [IX_ParentUnitOrTagNumberLookup] ON [dbo].[JDEFAAssetMasterFile]
(
	[AssetItemNumber] ASC,
	[UnitorTagNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_1]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEFAAssetMasterFile]') AND name = N'missing_index_1')
CREATE NONCLUSTERED INDEX [missing_index_1] ON [dbo].[JDEFAAssetMasterFile]
(
	[SourceID] ASC
)
INCLUDE ( 	[AssetItemNumber],
	[Category21Code],
	[Category21]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_113]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEGAAccountBalances]') AND name = N'missing_index_113')
CREATE NONCLUSTERED INDEX [missing_index_113] ON [dbo].[JDEGAAccountBalances]
(
	[LedgerTypeCode] ASC,
	[FiscalYear] ASC
)
INCLUDE ( 	[AccountID],
	[CompanyNumber],
	[PriorYearCloseBalance],
	[NetPosting01],
	[NetPosting02],
	[NetPosting03],
	[NetPosting04],
	[NetPosting05],
	[NetPosting06],
	[NetPosting07],
	[NetPosting08],
	[NetPosting09],
	[NetPosting10],
	[NetPosting11],
	[NetPosting12],
	[NetPosting13],
	[NetPosting14]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_JDEGAAccountLedger_GLDATE]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEGAAccountLedger]') AND name = N'IX_JDEGAAccountLedger_GLDATE')
CREATE NONCLUSTERED INDEX [IX_JDEGAAccountLedger_GLDATE] ON [dbo].[JDEGAAccountLedger]
(
	[GLDate] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_125]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEGAAccountLedger]') AND name = N'missing_index_125')
CREATE NONCLUSTERED INDEX [missing_index_125] ON [dbo].[JDEGAAccountLedger]
(
	[LedgerTypeCode] ASC,
	[DocumentType] ASC
)
INCLUDE ( 	[DocumentCompany],
	[DocumentNumber],
	[GLDate],
	[GLPostedCode],
	[BatchNumber],
	[BatchType],
	[BatchDate],
	[CompanyNumber],
	[AccountNumber],
	[AccountID],
	[BusinessUnitCode],
	[Object],
	[Subsidiary],
	[SubLedger],
	[GLPeriodNumber],
	[FiscalYear],
	[Amount],
	[Ref1JEVouchInvEtc],
	[Ref2AddressNumber],
	[PurchaseOrderDocumentType],
	[PONumber],
	[OrderTypeCode],
	[LineNumber],
	[UserID]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [_dta_index_JDEGAAccountMaster_BU]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEGAAccountMaster]') AND name = N'_dta_index_JDEGAAccountMaster_BU')
CREATE NONCLUSTERED INDEX [_dta_index_JDEGAAccountMaster_BU] ON [dbo].[JDEGAAccountMaster]
(
	[BusinessUnitCode] ASC,
	[Object] ASC,
	[CompanyNumber] ASC,
	[AccountID] ASC
)
INCLUDE ( 	[Subsidiary],
	[Description01]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [_dta_index_JDEGSBusinessUnitMaster_Comp]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSBusinessUnitMaster]') AND name = N'_dta_index_JDEGSBusinessUnitMaster_Comp')
CREATE NONCLUSTERED INDEX [_dta_index_JDEGSBusinessUnitMaster_Comp] ON [dbo].[JDEGSBusinessUnitMaster]
(
	[CompanyNumber] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_111]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSBusinessUnitMaster]') AND name = N'missing_index_111')
CREATE NONCLUSTERED INDEX [missing_index_111] ON [dbo].[JDEGSBusinessUnitMaster]
(
	[SourceID] ASC
)
INCLUDE ( 	[BusinessUnitCode],
	[Category16Code],
	[Category16]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_4]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEGSBusinessUnitMaster]') AND name = N'missing_index_4')
CREATE NONCLUSTERED INDEX [missing_index_4] ON [dbo].[JDEGSBusinessUnitMaster]
(
	[SourceID] ASC
)
INCLUDE ( 	[BusinessUnitCode],
	[Category05Code],
	[Category05]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_117]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINCostLedger]') AND name = N'missing_index_117')
CREATE NONCLUSTERED INDEX [missing_index_117] ON [dbo].[JDEINCostLedger]
(
	[InventoryCostingSelection] ASC,
	[CostMethodCode] ASC
)
INCLUDE ( 	[ItemNumber],
	[BusinessUnitCode],
	[Location],
	[LotNumber],
	[UnitCost]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_55]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINCostLedger]') AND name = N'missing_index_55')
CREATE NONCLUSTERED INDEX [missing_index_55] ON [dbo].[JDEINCostLedger]
(
	[ItemNumber] ASC,
	[InventoryCostingSelection] ASC
)
INCLUDE ( 	[BusinessUnitCode],
	[Location],
	[LotNumber],
	[CostMethodCode]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_69]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINCostLedger]') AND name = N'missing_index_69')
CREATE NONCLUSTERED INDEX [missing_index_69] ON [dbo].[JDEINCostLedger]
(
	[InventoryCostingSelection] ASC
)
INCLUDE ( 	[ItemNumber],
	[BusinessUnitCode],
	[Location],
	[LotNumber],
	[CostMethodCode]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_169]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemBranch]') AND name = N'missing_index_169')
CREATE NONCLUSTERED INDEX [missing_index_169] ON [dbo].[JDEINItemBranch]
(
	[SourceID] ASC
)
INCLUDE ( 	[ItemNumber],
	[BusinessUnitCode],
	[SalesCategory10Code],
	[SalesCategory10]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_491]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemBranch]') AND name = N'missing_index_491')
CREATE NONCLUSTERED INDEX [missing_index_491] ON [dbo].[JDEINItemBranch]
(
	[SourceID] ASC
)
INCLUDE ( 	[ItemNumber],
	[BusinessUnitCode],
	[SalesCategory06Code],
	[SalesCategory06]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_1384]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemLedger]') AND name = N'missing_index_1384')
CREATE NONCLUSTERED INDEX [missing_index_1384] ON [dbo].[JDEINItemLedger]
(
	[GLDate] ASC
)
INCLUDE ( 	[ItemNumber],
	[BusinessUnitCode],
	[DocumentNumber],
	[DocumentType],
	[PayItem]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_1386]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemLedger]') AND name = N'missing_index_1386')
CREATE NONCLUSTERED INDEX [missing_index_1386] ON [dbo].[JDEINItemLedger]
(
	[ItemNumber] ASC,
	[BusinessUnitCode] ASC,
	[GLDate] ASC
)
INCLUDE ( 	[DocumentNumber],
	[DocumentType],
	[PayItem],
	[Explanation]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [_dta_index_JDEINItemLocation_ItemNumber]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemLocation]') AND name = N'_dta_index_JDEINItemLocation_ItemNumber')
CREATE NONCLUSTERED INDEX [_dta_index_JDEINItemLocation_ItemNumber] ON [dbo].[JDEINItemLocation]
(
	[ItemNumber] ASC
)
INCLUDE ( 	[BusinessUnitCode],
	[Location],
	[LotNumber],
	[PrimaryLocation],
	[GLCategory],
	[LotStatusCode],
	[LastReceiptDate],
	[QuantityOnHand],
	[DateUpdated],
	[TimeOfDay]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [_dta_index_JDEINItemMaster_7_24491266__K3_K67]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemMaster]') AND name = N'_dta_index_JDEINItemMaster_7_24491266__K3_K67')
CREATE NONCLUSTERED INDEX [_dta_index_JDEINItemMaster_7_24491266__K3_K67] ON [dbo].[JDEINItemMaster]
(
	[ItemNumber] ASC,
	[UnitOfMeasurePrimary] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_166]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemMaster]') AND name = N'missing_index_166')
CREATE NONCLUSTERED INDEX [missing_index_166] ON [dbo].[JDEINItemMaster]
(
	[SourceID] ASC
)
INCLUDE ( 	[ItemNumber],
	[SalesCategory10Code],
	[SalesCategory10]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_488]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINItemMaster]') AND name = N'missing_index_488')
CREATE NONCLUSTERED INDEX [missing_index_488] ON [dbo].[JDEINItemMaster]
(
	[SourceID] ASC
)
INCLUDE ( 	[ItemNumber],
	[SalesCategory06Code],
	[SalesCategory06]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_RebateLookup]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINPriceAdjustmentHistory]') AND name = N'IX_RebateLookup')
CREATE NONCLUSTERED INDEX [IX_RebateLookup] ON [dbo].[JDEINPriceAdjustmentHistory]
(
	[SourceID] ASC,
	[OrderNumber] ASC,
	[OrderTypeCode] ASC,
	[OrderNumberDocumentCompany] ASC,
	[LineNumber] ASC,
	[SequenceNumber] ASC
)
INCLUDE ( 	[UnitPrice],
	[ForeignUnitPrice]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
GO
/****** Object:  Index [IX_SequenceNumber]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINPriceAdjustmentHistory]') AND name = N'IX_SequenceNumber')
CREATE NONCLUSTERED INDEX [IX_SequenceNumber] ON [dbo].[JDEINPriceAdjustmentHistory]
(
	[SequenceNumber] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_1]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINPriceAdjustmentHistory]') AND name = N'missing_index_1')
CREATE NONCLUSTERED INDEX [missing_index_1] ON [dbo].[JDEINPriceAdjustmentHistory]
(
	[SequenceNumber] ASC
)
INCLUDE ( 	[SourceID],
	[OrderNumber],
	[OrderTypeCode],
	[OrderNumberDocumentCompany],
	[LineNumber],
	[UnitPrice],
	[ForeignUnitPrice]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [_dta_index_JDEINUOMConversionFactors_BU]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINUOMConversionFactors]') AND name = N'_dta_index_JDEINUOMConversionFactors_BU')
CREATE NONCLUSTERED INDEX [_dta_index_JDEINUOMConversionFactors_BU] ON [dbo].[JDEINUOMConversionFactors]
(
	[BusinessUnitCode] ASC,
	[ItemNumber] ASC,
	[UnitOfMeasure] ASC,
	[ConvFactorSecondaryToPrimary] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_237]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINUOMConversionFactors]') AND name = N'missing_index_237')
CREATE NONCLUSTERED INDEX [missing_index_237] ON [dbo].[JDEINUOMConversionFactors]
(
	[ItemNumber] ASC,
	[UnitOfMeasure] ASC,
	[ConvFactorSecondaryToPrimary] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_240]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEINUOMConversionFactors]') AND name = N'missing_index_240')
CREATE NONCLUSTERED INDEX [missing_index_240] ON [dbo].[JDEINUOMConversionFactors]
(
	[ItemNumber] ASC,
	[RelatedUnitOfMeasure] ASC,
	[ConversionFactor] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_InternalPaymentID]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARCheckDetail]') AND name = N'IX_InternalPaymentID')
CREATE NONCLUSTERED INDEX [IX_InternalPaymentID] ON [dbo].[JDEOWARCheckDetail]
(
	[SourceID] ASC,
	[InternalPaymentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_GLDate]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARLedger]') AND name = N'IX_GLDate')
CREATE NONCLUSTERED INDEX [IX_GLDate] ON [dbo].[JDEOWARLedger]
(
	[GLDate] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_SalesDocNumTypePayitem]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARLedger]') AND name = N'IX_SalesDocNumTypePayitem')
CREATE NONCLUSTERED INDEX [IX_SalesDocNumTypePayitem] ON [dbo].[JDEOWARLedger]
(
	[SalesDocumentNumber] ASC,
	[SalesDocumentType] ASC,
	[PayItem] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_611]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARLedger]') AND name = N'missing_index_611')
CREATE NONCLUSTERED INDEX [missing_index_611] ON [dbo].[JDEOWARLedger]
(
	[PayStatus] ASC,
	[BusinessUnitCode] ASC
)
INCLUDE ( 	[AddressNumber],
	[GrossAmount],
	[OpenAmount]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [IX_InternalPaymentID]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEOWARReceiptsHeaderFile]') AND name = N'IX_InternalPaymentID')
CREATE NONCLUSTERED INDEX [IX_InternalPaymentID] ON [dbo].[JDEOWARReceiptsHeaderFile]
(
	[SourceID] ASC,
	[InternalPaymentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_67]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDEPDItemCostComponent]') AND name = N'missing_index_67')
CREATE NONCLUSTERED INDEX [missing_index_67] ON [dbo].[JDEPDItemCostComponent]
(
	[CostType] ASC
)
INCLUDE ( 	[ItemNumber],
	[ItemNumber02],
	[Branch],
	[Location],
	[LotNumber],
	[CostMethodCode],
	[ManufacturedCostFrozen],
	[ManufacturedCostSimulated],
	[CostRollupFrozen],
	[CostRollupSimulated]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_115]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESFControlRoutingInstruct]') AND name = N'missing_index_115')
CREATE NONCLUSTERED INDEX [missing_index_115] ON [dbo].[JDESFControlRoutingInstruct]
(
	[PrimaryLastSupplierNumber] ASC
)
INCLUDE ( 	[OrderNumber],
	[OrderTypeCode],
	[ItemNumber2ndKit],
	[Branch],
	[OperationsSequenceNumber],
	[RelatedOrderKeyCompany],
	[RelatedPoSoWoNumber],
	[RelatedPoSoWoType],
	[RelatedPOSOLineNumber],
	[DateUpdated]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_223]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESFWOCrossReferenceFile]') AND name = N'missing_index_223')
CREATE NONCLUSTERED INDEX [missing_index_223] ON [dbo].[JDESFWOCrossReferenceFile]
(
	[WorkStationID] ASC
)
INCLUDE ( 	[OrderNumber],
	[DocumentNumber]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON

GO
/****** Object:  Index [missing_index_442]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESFWOCrossReferenceFile]') AND name = N'missing_index_442')
CREATE NONCLUSTERED INDEX [missing_index_442] ON [dbo].[JDESFWOCrossReferenceFile]
(
	[DocumentNumber] ASC,
	[DocumentType] ASC,
	[BatchNumber] ASC
)
INCLUDE ( 	[OrderNumber]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [_dta_index_JDESOSalesOrderDetail_Status02]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderDetail]') AND name = N'_dta_index_JDESOSalesOrderDetail_Status02')
CREATE NONCLUSTERED INDEX [_dta_index_JDESOSalesOrderDetail_Status02] ON [dbo].[JDESOSalesOrderDetail]
(
	[SalesOrderStatus02] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [_dta_index_JDESOSalesOrderDetail_Status02_]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderDetail]') AND name = N'_dta_index_JDESOSalesOrderDetail_Status02_')
CREATE NONCLUSTERED INDEX [_dta_index_JDESOSalesOrderDetail_Status02_] ON [dbo].[JDESOSalesOrderDetail]
(
	[SalesOrderStatus02] ASC
)
INCLUDE ( 	[OrderNumberDocumentCompany],
	[OrderNumber],
	[OrderTypeCode],
	[LineNumber],
	[BusinessUnitCode],
	[CompanyNumber],
	[OriginalOrderDocumentCompany],
	[OriginalOrderNumber],
	[OriginalOrderTypeCode],
	[OriginalLineNumber],
	[RelatedOrderKeyCompany],
	[RelatedPoSoWoNumber],
	[RelatedPoSoWoType],
	[RelatedPOSOLineNumber],
	[AddressNumber],
	[ShipToNumber],
	[GLDate],
	[ItemNumber02],
	[Location],
	[LotNumber],
	[LineType],
	[StatusCodeNext],
	[StatusCodeLast],
	[UnitOfMeasureAsInput],
	[QuantityShipped],
	[QuantityBackordered],
	[UnitPrice],
	[ExtendedPrice],
	[UnitCost],
	[ExtendedCost],
	[CostOverrideCode],
	[TransferCost],
	[DocumentNumber],
	[DocumentType],
	[OriginalDocumentNumber],
	[OriginalDocumentTypeCode],
	[OriginalDocumentCompany],
	[UnitOfMeasurePrimary],
	[PrimaryQuantityOrdered],
	[GLOffset],
	[SalesOrderStatus01]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_119]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderDetail]') AND name = N'missing_index_119')
CREATE NONCLUSTERED INDEX [missing_index_119] ON [dbo].[JDESOSalesOrderDetail]
(
	[SalesOrderStatus02] ASC,
	[TransactionDate] ASC
)
INCLUDE ( 	[OrderNumberDocumentCompany],
	[OrderNumber],
	[OrderTypeCode],
	[LineNumber],
	[BusinessUnitCode],
	[CompanyNumber],
	[OriginalOrderDocumentCompany],
	[OriginalOrderNumber],
	[OriginalOrderTypeCode],
	[OriginalLineNumber],
	[RelatedOrderKeyCompany],
	[RelatedPoSoWoNumber],
	[RelatedPoSoWoType],
	[RelatedPOSOLineNumber],
	[AddressNumber],
	[ShipToNumber],
	[GLDate],
	[ItemNumber02],
	[Location],
	[LotNumber],
	[LineType],
	[StatusCodeNext],
	[StatusCodeLast],
	[UnitOfMeasureAsInput],
	[QuantityShipped],
	[QuantityBackordered],
	[UnitPrice],
	[ExtendedPrice],
	[UnitCost],
	[ExtendedCost],
	[CostOverrideCode],
	[TransferCost],
	[DocumentNumber],
	[DocumentType],
	[OriginalDocumentNumber],
	[OriginalDocumentTypeCode],
	[OriginalDocumentCompany],
	[UnitOfMeasurePrimary],
	[PrimaryQuantityOrdered],
	[GLOffset],
	[SalesOrderStatus01]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_121]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderDetail]') AND name = N'missing_index_121')
CREATE NONCLUSTERED INDEX [missing_index_121] ON [dbo].[JDESOSalesOrderDetail]
(
	[SalesOrderStatus02] ASC
)
INCLUDE ( 	[OrderNumberDocumentCompany],
	[OrderNumber],
	[OrderTypeCode],
	[LineNumber],
	[BusinessUnitCode],
	[CompanyNumber],
	[OriginalOrderDocumentCompany],
	[OriginalOrderNumber],
	[OriginalOrderTypeCode],
	[OriginalLineNumber],
	[RelatedOrderKeyCompany],
	[RelatedPoSoWoNumber],
	[RelatedPoSoWoType],
	[RelatedPOSOLineNumber],
	[AddressNumber],
	[ShipToNumber],
	[TransactionDate],
	[GLDate],
	[ItemNumber02],
	[Location],
	[LotNumber],
	[LineType],
	[StatusCodeNext],
	[StatusCodeLast],
	[UnitOfMeasureAsInput],
	[QuantityShipped],
	[QuantityBackordered],
	[UnitPrice],
	[ExtendedPrice],
	[UnitCost],
	[ExtendedCost],
	[CostOverrideCode],
	[TransferCost],
	[DocumentNumber],
	[DocumentType],
	[OriginalDocumentNumber],
	[OriginalDocumentTypeCode],
	[OriginalDocumentCompany],
	[UnitOfMeasurePrimary],
	[PrimaryQuantityOrdered],
	[GLOffset],
	[SalesOrderStatus01]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_342]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderDetail]') AND name = N'missing_index_342')
CREATE NONCLUSTERED INDEX [missing_index_342] ON [dbo].[JDESOSalesOrderDetail]
(
	[SourceID] ASC
)
INCLUDE ( 	[OrderNumberDocumentCompany],
	[OrderNumber],
	[OrderTypeCode],
	[LineNumber],
	[OrderSuffix]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
/****** Object:  Index [missing_index_127]    Script Date: 5/30/13 10:14:48 AM ******/
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[JDESOSalesOrderDetailHistory]') AND name = N'missing_index_127')
CREATE NONCLUSTERED INDEX [missing_index_127] ON [dbo].[JDESOSalesOrderDetailHistory]
(
	[GLDate] ASC
)
INCLUDE ( 	[OrderNumberDocumentCompany],
	[OrderNumber],
	[OrderTypeCode],
	[LineNumber],
	[BusinessUnitCode],
	[CompanyNumber],
	[OriginalOrderDocumentCompany],
	[OriginalOrderNumber],
	[OriginalOrderTypeCode],
	[OriginalLineNumber],
	[RelatedOrderKeyCompany],
	[RelatedPoSoWoNumber],
	[RelatedPoSoWoType],
	[RelatedPOSOLineNumber],
	[AddressNumber],
	[ShipToNumber],
	[ItemNumber02],
	[Location],
	[LotNumber],
	[LineType],
	[StatusCodeNext],
	[StatusCodeLast],
	[UnitOfMeasureAsInput],
	[QuantityShipped],
	[QuantityBackordered],
	[UnitPrice],
	[ExtendedPrice],
	[UnitCost],
	[ExtendedCost],
	[CostOverrideCode],
	[TransferCost],
	[DocumentNumber],
	[DocumentType],
	[OriginalDocumentNumber],
	[OriginalDocumentTypeCode],
	[OriginalDocumentCompany],
	[UnitOfMeasurePrimary],
	[PrimaryQuantityOrdered],
	[GLOffset],
	[SalesOrderStatus01],
	[SalesOrderStatus02]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
